diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-23 19:17:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-23 19:17:46 +0300 |
commit | 055600d34539311ec30746b0e7bb9c66030da779 (patch) | |
tree | 3ab03dc74fc02c257a0ef44416c96bc3f568cfcc | |
parent | 2b10bc5fbbb7f387faad2cc9d74d62abd8ff466c (diff) |
thy shall not call remove() inside iterators, or break a loop immediately
-rw-r--r-- | src/mir_app/src/meta_services.cpp | 8 |
1 files 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;
}
|