Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3537)

Unified Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 2901193002: Fix nullptr dereference of ToolbarActionView (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/browser_actions_container.cc
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
index f2f57fde20840666b257fb63c01a9f71803c124d..e32013b179893baae84364e447b26675ec4be7ef 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -168,9 +168,11 @@ void BrowserActionsContainer::AddViewForAction(
void BrowserActionsContainer::RemoveViewForAction(
ToolbarActionViewController* action) {
+ std::unique_ptr<ToolbarActionView> view;
for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin();
iter != toolbar_action_views_.end(); ++iter) {
if ((*iter)->view_controller() == action) {
+ std::swap(view, *iter);
toolbar_action_views_.erase(iter);
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698