Fix crash in OSX

Resizing of screen can only be done in main thread
This commit is contained in:
Benau 2020-06-16 09:59:02 +08:00
parent d1ab5f8aaf
commit 945565790c

View File

@ -127,7 +127,8 @@ World* World::m_world[PT_COUNT];
*/
World::World() : WorldStatus()
{
GUIEngine::getDevice()->setResizable(true);
if (m_process_type == PT_MAIN)
GUIEngine::getDevice()->setResizable(true);
RewindManager::setEnable(NetworkConfig::get()->isNetworking());
#ifdef DEBUG
m_magic_number = 0xB01D6543;
@ -602,9 +603,11 @@ Controller* World::loadAIController(AbstractKart* kart)
//-----------------------------------------------------------------------------
World::~World()
{
GUIEngine::getDevice()->setResizable(false);
if (m_process_type == PT_MAIN)
{
GUIEngine::getDevice()->setResizable(false);
material_manager->unloadAllTextures();
}
RewindManager::destroy();