From 252cc25ecd22978611c441e08df59de446c1bb50 Mon Sep 17 00:00:00 2001 From: "erikkay@google.com" Date: Thu, 26 Feb 2009 18:07:50 +0000 Subject: 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 --- chrome/browser/extensions/extensions_service.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 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 -- cgit v1.1