summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 18:07:50 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 18:07:50 +0000
commit252cc25ecd22978611c441e08df59de446c1bb50 (patch)
tree493079c63d28bd4df6e6205d15f938a314bec21a
parent9f156b1a76315832dde611d60e675ba6680e4fc2 (diff)
downloadchromium_src-252cc25ecd22978611c441e08df59de446c1bb50.zip
chromium_src-252cc25ecd22978611c441e08df59de446c1bb50.tar.gz
chromium_src-252cc25ecd22978611c441e08df59de446c1bb50.tar.bz2
Fix a memory leak in extension install.
Review URL: http://codereview.chromium.org/27215 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10482 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extensions_service.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 1446e7b..4c1a40f 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -717,7 +717,17 @@ void ExtensionsServiceBackend::ReportExtensionInstalled(
// After it's installed, load it right away with the same settings.
extension_path_ = path;
- LoadExtensionCurrentVersion();
+ LOG(INFO) << "Loading extension " << path.value();
+ Extension* extension = LoadExtensionCurrentVersion();
+ if (extension) {
+ // Only one extension, but ReportExtensionsLoaded can handle multiple,
+ // so we need to construct a list.
+ scoped_ptr<ExtensionList> extensions(new ExtensionList);
+ extensions->push_back(extension);
+ LOG(INFO) << "Done.";
+ // Hand off ownership of the loaded extensions to the frontend.
+ ReportExtensionsLoaded(extensions.release());
+ }
}
// Some extensions will autoupdate themselves externally from Chrome. These