Fixing crash in Allocator if there are no allocated pages (#12908)

This commit is contained in:
Milos Jakovljevic 2017-11-21 03:56:29 +01:00 committed by minggo
parent a8b6e33d9c
commit ff8d2cc20f
1 changed files with 1 additions and 2 deletions

View File

@ -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