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

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

Issue 12383057: Merge 185412 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_host_installer_win.cc
===================================================================
--- chrome/browser/extensions/app_host_installer_win.cc (revision 185570)
+++ chrome/browser/extensions/app_host_installer_win.cc (working copy)
@@ -70,17 +70,23 @@
QuickEnableDelegate::~QuickEnableDelegate() {}
void QuickEnableDelegate::OnObjectSignaled(HANDLE object) {
+ // Reset callback_ to free up references. But do it now because it's possible
+ // that callback_.Run() will cause this object to be deleted.
+ OnAppHostInstallationCompleteCallback callback(callback_);
+ callback_.Reset();
+
int exit_code = 0;
base::TerminationStatus status(
base::GetTerminationStatus(object, &exit_code));
if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION) {
- callback_.Run(true);
+ callback.Run(true);
} else {
LOG(ERROR) << "App Launcher install failed, status = " << status
<< ", exit code = " << exit_code;
- callback_.Run(false);
+ callback.Run(false);
}
- callback_.Reset();
+
+ // At this point 'this' may be deleted. Don't do anything else here.
}
// Reads the path to app_host.exe from the value "UninstallString" within the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698