Skip to content
Snippets Groups Projects
Commit 1cf2b355 authored by John Kessenich's avatar John Kessenich
Browse files

Memory: Fix #705: don't use pool object after invoking destructor.

parent fd1d07da
No related branches found
No related tags found
No related merge requests found
......@@ -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<char*>(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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment