summaryrefslogtreecommitdiffstats
path: root/chrome/browser/child_process_security_policy.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 21:02:58 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 21:02:58 +0000
commit79dc62e3412845f97c91db5792d0049783e4c7c3 (patch)
tree567c2b2cba1c881a7cbcf1eb0103c944ea409ff2 /chrome/browser/child_process_security_policy.cc
parentf5cdaff1456dfd7a5ad2240115285010a32f7fc1 (diff)
downloadchromium_src-79dc62e3412845f97c91db5792d0049783e4c7c3.zip
chromium_src-79dc62e3412845f97c91db5792d0049783e4c7c3.tar.gz
chromium_src-79dc62e3412845f97c91db5792d0049783e4c7c3.tar.bz2
Fix memory leaks when a renderer crashes and the user refreshes. Also fix memory leak every time a renderer process goes away.
Review URL: http://codereview.chromium.org/115492 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_security_policy.cc')
-rw-r--r--chrome/browser/child_process_security_policy.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/chrome/browser/child_process_security_policy.cc b/chrome/browser/child_process_security_policy.cc
index f853c10..6a408bb1 100644
--- a/chrome/browser/child_process_security_policy.cc
+++ b/chrome/browser/child_process_security_policy.cc
@@ -118,10 +118,8 @@ void ChildProcessSecurityPolicy::Add(int renderer_id) {
void ChildProcessSecurityPolicy::Remove(int renderer_id) {
AutoLock lock(lock_);
- if (security_state_.count(renderer_id) != 1) {
- NOTREACHED() << "Remove renderers at most once.";
- return;
- }
+ if (!security_state_.count(renderer_id))
+ return; // May be called multiple times.
delete security_state_[renderer_id];
security_state_.erase(renderer_id);