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