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

Unified Diff: content/browser/manifest/manifest_manager_host.cc

Issue 667053007: Use manifest for streamlined hosted app creation for title and URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Fix memory leak in manifest_manager_host Created 6 years, 2 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 | « chrome/browser/extensions/tab_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/manifest/manifest_manager_host.cc
diff --git a/content/browser/manifest/manifest_manager_host.cc b/content/browser/manifest/manifest_manager_host.cc
index 962189fff3d86ec5a1773361f66b3e04dea46381..50b3ecade66ca6ab3dd258dc8785787920962c71 100644
--- a/content/browser/manifest/manifest_manager_host.cc
+++ b/content/browser/manifest/manifest_manager_host.cc
@@ -44,11 +44,14 @@ void ManifestManagerHost::RenderFrameDeleted(
return;
// Before deleting the callbacks, make sure they are called with a failure
- // state.
- CallbackMap::const_iterator it(callbacks);
- for (; !it.IsAtEnd(); it.Advance())
- it.GetCurrentValue()->Run(Manifest());
+ // state. Do this in a block so the iterator is destroyed before |callbacks|.
+ {
+ CallbackMap::const_iterator it(callbacks);
+ for (; !it.IsAtEnd(); it.Advance())
+ it.GetCurrentValue()->Run(Manifest());
+ }
+ delete callbacks;
pending_callbacks_.erase(render_frame_host);
}
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698