summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-07 17:52:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-07 17:52:01 +0300
commitc13e5563e2e248992a201466a9ce1c73b3c58808 (patch)
tree634851a4404c61ebb5c4d4e6fc29473e81826762 /src/mir_app
parent68d2c9566660c706ec13564ec7bc029cd85a6752 (diff)
fixes occasional crash on exit
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat_manager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index 6078ec9d3a..77b6a8a905 100644
--- a/src/mir_app/src/chat_manager.cpp
+++ b/src/mir_app/src/chat_manager.cpp
@@ -379,9 +379,10 @@ BOOL SM_ChangeNick(const wchar_t *pszID, const char *pszModule, GCEVENT *gce)
void SM_RemoveAll(void)
{
- for (auto &it : g_arSessions)
+ for (auto &it : g_arSessions.rev_iter()) {
SM_FreeSession(it, false);
- g_arSessions.destroy();
+ g_arSessions.remove(g_arSessions.indexOf(&it));
+ }
}
static void SM_AddCommand(const wchar_t *pszID, const char *pszModule, const char* lpNewCommand)