From c13e5563e2e248992a201466a9ce1c73b3c58808 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 7 Feb 2019 17:52:01 +0300 Subject: fixes occasional crash on exit --- src/mir_app/src/chat_manager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mir_app') 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) -- cgit v1.2.3