From ff8d2cc20f9a7b8918ebebc6271064ecb109918b Mon Sep 17 00:00:00 2001 From: Milos Jakovljevic Date: Tue, 21 Nov 2017 03:56:29 +0100 Subject: [PATCH] Fixing crash in Allocator if there are no allocated pages (#12908) --- cocos/base/allocator/CCAllocatorStrategyFixedBlock.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h b/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h index 40067fbe4d..1e571480c7 100644 --- a/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h +++ b/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h @@ -89,14 +89,13 @@ public: AllocatorDiagnostics::instance()->untrackAllocator(this); #endif - do + while (_pages) { intptr_t* page = (intptr_t*)_pages; intptr_t* next = (intptr_t*)*page; ccAllocatorGlobal.deallocate(page); _pages = (void*)next; } - while (_pages); } // @brief