From 055600d34539311ec30746b0e7bb9c66030da779 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 23 Feb 2018 19:17:46 +0300 Subject: thy shall not call remove() inside iterators, or break a loop immediately --- src/mir_app/src/meta_services.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 79d91aacb5..debea67c02 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -554,11 +554,13 @@ static int Meta_MessageWindowEvent(WPARAM, LPARAM lParam) } } } - else if (mwed->uType == MSG_WINDOW_EVT_CLOSING) { + else if (mwed->uType == MSG_WINDOW_EVT_CLOSING) for (auto &p : arMetaWindows) - if (p->m_hWnd == mwed->hwndWindow) + if (p->m_hWnd == mwed->hwndWindow) { arMetaWindows.remove(p); - } + break; + } + return 0; } -- cgit v1.2.3