mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3698 from minggo/develop
make Director::end() reantrant
This commit is contained in:
commit
fa71f8f479
|
@ -704,8 +704,11 @@ void Director::purgeDirector()
|
|||
CHECK_GL_ERROR_DEBUG();
|
||||
|
||||
// OpenGL view
|
||||
_openGLView->end();
|
||||
_openGLView = nullptr;
|
||||
if (_openGLView)
|
||||
{
|
||||
_openGLView->end();
|
||||
_openGLView = nullptr;
|
||||
}
|
||||
|
||||
// delete Director
|
||||
release();
|
||||
|
|
|
@ -66,8 +66,14 @@ void km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut)
|
|||
stack->top = &stack->stack[stack->item_count - 1];
|
||||
}
|
||||
|
||||
void km_mat4_stack_release(km_mat4_stack* stack) {
|
||||
free(stack->stack);
|
||||
void km_mat4_stack_release(km_mat4_stack* stack)
|
||||
{
|
||||
if (stack->stack)
|
||||
{
|
||||
free(stack->stack);
|
||||
stack->stack = NULL;
|
||||
}
|
||||
|
||||
stack->top = NULL;
|
||||
stack->item_count = 0;
|
||||
stack->capacity = 0;
|
||||
|
|
|
@ -503,6 +503,7 @@ UserDefault* UserDefault::getInstance()
|
|||
|
||||
void UserDefault::destroyInstance()
|
||||
{
|
||||
delete _userDefault;
|
||||
_userDefault = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,12 +89,15 @@ TextureCache::~TextureCache()
|
|||
|
||||
void TextureCache::destroyInstance()
|
||||
{
|
||||
// notify sub thread to quick
|
||||
_sharedTextureCache->_needQuit = true;
|
||||
_sharedTextureCache->_sleepCondition.notify_one();
|
||||
if (_sharedTextureCache->_loadingThread) _sharedTextureCache->_loadingThread->join();
|
||||
|
||||
CC_SAFE_RELEASE_NULL(_sharedTextureCache);
|
||||
if (_sharedTextureCache)
|
||||
{
|
||||
// notify sub thread to quick
|
||||
_sharedTextureCache->_needQuit = true;
|
||||
_sharedTextureCache->_sleepCondition.notify_one();
|
||||
if (_sharedTextureCache->_loadingThread) _sharedTextureCache->_loadingThread->join();
|
||||
|
||||
CC_SAFE_RELEASE_NULL(_sharedTextureCache);
|
||||
}
|
||||
}
|
||||
|
||||
const char* TextureCache::description() const
|
||||
|
|
Loading…
Reference in New Issue