mirror of https://github.com/axmolengine/axmol.git
Fixing crash in Allocator if there are no allocated pages (#12908)
This commit is contained in:
parent
a8b6e33d9c
commit
ff8d2cc20f
|
@ -89,14 +89,13 @@ public:
|
||||||
AllocatorDiagnostics::instance()->untrackAllocator(this);
|
AllocatorDiagnostics::instance()->untrackAllocator(this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
do
|
while (_pages)
|
||||||
{
|
{
|
||||||
intptr_t* page = (intptr_t*)_pages;
|
intptr_t* page = (intptr_t*)_pages;
|
||||||
intptr_t* next = (intptr_t*)*page;
|
intptr_t* next = (intptr_t*)*page;
|
||||||
ccAllocatorGlobal.deallocate(page);
|
ccAllocatorGlobal.deallocate(page);
|
||||||
_pages = (void*)next;
|
_pages = (void*)next;
|
||||||
}
|
}
|
||||||
while (_pages);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @brief
|
// @brief
|
||||||
|
|
Loading…
Reference in New Issue