From 94701d93155a78a3737eec9dc6df59163b9c40c1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 29 May 2012 15:23:16 +0800 Subject: [PATCH] fixed #1268: Testjs will crash after clicking the close button on win32. Also, fixed a bug in CCTextureCache::~CCTextureCache(). --- cocos2dx/textures/CCTextureCache.cpp | 6 +++++- js/JSBindings/cocos2d_generated.cpp.REMOVED.git-id | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos2dx/textures/CCTextureCache.cpp b/cocos2dx/textures/CCTextureCache.cpp index 5480fb716f..786b6f7c24 100644 --- a/cocos2dx/textures/CCTextureCache.cpp +++ b/cocos2dx/textures/CCTextureCache.cpp @@ -216,7 +216,11 @@ CCTextureCache::~CCTextureCache() { CCLOGINFO("cocos2d: deallocing CCTextureCache."); need_quit = true; - sem_post(s_pSem); + if (s_pSem != NULL) + { + sem_post(s_pSem); + } + CC_SAFE_RELEASE(m_pTextures); } diff --git a/js/JSBindings/cocos2d_generated.cpp.REMOVED.git-id b/js/JSBindings/cocos2d_generated.cpp.REMOVED.git-id index b3c5cf7698..102c2b22e2 100644 --- a/js/JSBindings/cocos2d_generated.cpp.REMOVED.git-id +++ b/js/JSBindings/cocos2d_generated.cpp.REMOVED.git-id @@ -1 +1 @@ -f4135b2df3172fad12bfdcceef903b4acead4ca6 \ No newline at end of file +2dcb2216223f82c1f3e4a505c8b446f6acb4ff03 \ No newline at end of file