diff --git a/glslang/MachineIndependent/PoolAlloc.cpp b/glslang/MachineIndependent/PoolAlloc.cpp index c42057c2..7d07a399 100644 --- a/glslang/MachineIndependent/PoolAlloc.cpp +++ b/glslang/MachineIndependent/PoolAlloc.cpp @@ -201,15 +201,15 @@ void TPoolAllocator::pop() currentPageOffset = stack.back().offset; while (inUseList != page) { - // invoke destructor to free allocation list - inUseList->~tHeader(); - tHeader* nextInUse = inUseList->nextPage; - if (inUseList->pageCount > 1) + if (inUseList->pageCount > 1) { + inUseList->~tHeader(); // currently, just a debug allocation checker delete [] reinterpret_cast(inUseList); - else { + } else { inUseList->nextPage = freeList; freeList = inUseList; + // inUseList->~tHeader(); TODO: this should probably call the allocation checker, but not the destructor + // ...if the destructor actually overwrites nextPage, that would effect freeList->nextPage } inUseList = nextInUse; }