Clear message queue when destroying GUIEngine
So it won't call font which could already been reset
This commit is contained in:
parent
660a35a468
commit
1d74efcd08
@ -834,6 +834,7 @@ namespace GUIEngine
|
||||
needsUpdate.clearWithoutDeleting();
|
||||
|
||||
gui_messages.clear();
|
||||
MessageQueue::clear();
|
||||
} // clear
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -384,6 +384,23 @@ void showProgressBar(int progress, const core::stringw& msg)
|
||||
#endif
|
||||
} // showProgressBar
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Clear all message, called when destroying the GUIEngine.
|
||||
*/
|
||||
void clear()
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
g_all_messages.lock();
|
||||
while (!g_all_messages.getData().empty())
|
||||
{
|
||||
Message* msg = g_all_messages.getData().top();
|
||||
delete msg;
|
||||
g_all_messages.getData().pop();
|
||||
}
|
||||
g_all_messages.unlock();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace GUIEngine
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -47,6 +47,6 @@ namespace MessageQueue
|
||||
void showProgressBar(int progress, const core::stringw& msg);
|
||||
void updatePosition();
|
||||
void update(float dt);
|
||||
|
||||
void clear();
|
||||
}; // namespace GUIEngine
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user