Clear some global variables for android
This commit is contained in:
@@ -1037,6 +1037,19 @@ namespace GUIEngine
|
||||
g_loaded_screens.clearAndDeleteAll();
|
||||
} // deallocate
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
void resetGlobalVariables()
|
||||
{
|
||||
// Try to clear global variable for android to avoid crashes
|
||||
needsUpdate.m_contents_vector.clear();
|
||||
g_loaded_screens.m_contents_vector.clear();
|
||||
g_current_screen = NULL;
|
||||
gui_messages.clear();
|
||||
#ifdef ANDROID
|
||||
m_gui_functions.clear();
|
||||
#endif
|
||||
} // resetGlobalVariables
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
void init(IrrlichtDevice* device_a, IVideoDriver* driver_a,
|
||||
AbstractStateManager* state_manager, bool loading)
|
||||
|
||||
@@ -116,6 +116,7 @@ namespace GUIEngine
|
||||
|
||||
void deallocate();
|
||||
|
||||
void resetGlobalVariables();
|
||||
|
||||
/**
|
||||
* \return the irrlicht device object
|
||||
|
||||
@@ -1701,6 +1701,8 @@ void clearGlobalVariables()
|
||||
#ifdef ENABLE_WIIUSE
|
||||
wiimote_manager = NULL;
|
||||
#endif
|
||||
World::setWorld(NULL);
|
||||
GUIEngine::resetGlobalVariables();
|
||||
} // clearGlobalVariables
|
||||
|
||||
//=============================================================================
|
||||
|
||||
Reference in New Issue
Block a user