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

Unified Diff: chrome/browser/extensions/extension_pref_store.cc

Issue 2923008: Fix memory leak in extension pref store... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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/extension_pref_store.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_pref_store.cc
===================================================================
--- chrome/browser/extensions/extension_pref_store.cc (revision 52128)
+++ chrome/browser/extensions/extension_pref_store.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/extension_pref_store.h"
#include "base/logging.h"
+#include "base/stl_util-inl.h"
#include "base/values.h"
#include "chrome/browser/pref_service.h"
@@ -13,6 +14,10 @@
prefs_(new DictionaryValue()) {
}
+ExtensionPrefStore::~ExtensionPrefStore() {
+ STLDeleteElements(&extension_stack_);
+}
+
// This could be sped up by keeping track of which extension currently controls
// a given preference, among other optimizations. But we estimate that fewer
// than 10 installed extensions will be trying to control any preferences, so
@@ -87,6 +92,7 @@
i != extension_stack_.end(); ++i) {
if ((*i)->extension_id == extension_id) {
pref_values.reset((*i)->pref_values);
+ delete *i;
extension_stack_.erase(i);
break;
}
« no previous file with comments | « chrome/browser/extensions/extension_pref_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698