diff --git a/dep/g3dlite/System.cpp b/dep/g3dlite/System.cpp index 6daa3bd534..7630aef9b4 100644 --- a/dep/g3dlite/System.cpp +++ b/dep/g3dlite/System.cpp @@ -1334,11 +1334,12 @@ class BufferPool { ++medPoolSize; return; } - bytesAllocated -= USERSIZE_TO_REALSIZE(bytes); - - // Free; the buffer pools are full or this is too big to store. - ::free(USERPTR_TO_REALPTR(ptr)); } + + bytesAllocated -= USERSIZE_TO_REALSIZE(bytes); + + // Free; the buffer pools are full or this is too big to store. + ::free(USERPTR_TO_REALPTR(ptr)); } }