mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix potential iterator validity issue in RootWindowManager::CloseAllWindows (issue #2514)
This commit is contained in:
@@ -263,8 +263,12 @@ void RootWindowManager::CloseAllWindows(bool force) {
|
|||||||
if (root_windows_.empty())
|
if (root_windows_.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RootWindowSet::const_iterator it = root_windows_.begin();
|
// Use a copy of |root_windows_| because the original set may be modified
|
||||||
for (; it != root_windows_.end(); ++it)
|
// in OnRootWindowDestroyed while iterating.
|
||||||
|
RootWindowSet root_windows = root_windows_;
|
||||||
|
|
||||||
|
RootWindowSet::const_iterator it = root_windows.begin();
|
||||||
|
for (; it != root_windows.end(); ++it)
|
||||||
(*it)->Close(force);
|
(*it)->Close(force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user