From 73c318d10576e4282fdfd8ca6e2b352e3a426074 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 21 Jul 2017 15:22:09 +0800 Subject: [PATCH] memory leak fix in CCTextureCache::addImageAsync. --- native/cocos/renderer/CCTextureCache.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/cocos/renderer/CCTextureCache.cpp b/native/cocos/renderer/CCTextureCache.cpp index e377d514e6..30ef33b4fe 100644 --- a/native/cocos/renderer/CCTextureCache.cpp +++ b/native/cocos/renderer/CCTextureCache.cpp @@ -572,6 +572,9 @@ void TextureCache::waitForQuit() _needQuit = true; _sleepCondition.notify_one(); if (_loadingThread) _loadingThread->join(); + + // Clear async tasks which are still in the queue. + addImageAsyncCallBack(0.0f); } std::string TextureCache::getCachedTextureInfo() const