Fix crash caused by pop sorting with deleted message

This commit is contained in:
Benau 2020-02-04 01:26:26 +08:00
parent d147291e2a
commit f8bce05dd6

View File

@ -487,8 +487,8 @@ void clear()
while (!g_all_messages.getData().empty()) while (!g_all_messages.getData().empty())
{ {
Message* msg = g_all_messages.getData().top(); Message* msg = g_all_messages.getData().top();
delete msg;
g_all_messages.getData().pop(); g_all_messages.getData().pop();
delete msg;
} }
g_all_messages.unlock(); g_all_messages.unlock();
#endif #endif