Fix crash when cancelling an install download via quitting the app.

This commit is contained in:
ben%bengoodger.com 2003-12-11 01:05:29 +00:00
parent cde28321b3
commit 8b6386c7d9

View File

@ -132,10 +132,6 @@ nsDownloadManager::~nsDownloadManager()
NS_IF_RELEASE(gNC_DateStarted); NS_IF_RELEASE(gNC_DateStarted);
NS_IF_RELEASE(gNC_DateEnded); NS_IF_RELEASE(gNC_DateEnded);
// Download Manager is shutting down! Tell the XPInstallManager to stop
// transferring any files that may have been being downloaded.
gObserverService->NotifyObservers(mXPIProgress, "xpinstall-progress", NS_LITERAL_STRING("cancel").get());
NS_RELEASE(gRDFService); NS_RELEASE(gRDFService);
NS_RELEASE(gObserverService); NS_RELEASE(gObserverService);
} }
@ -1176,6 +1172,10 @@ nsDownloadManager::Observe(nsISupports* aSubject, const char* aTopic, const PRUn
gEnumeratingDownloads = PR_TRUE; gEnumeratingDownloads = PR_TRUE;
mCurrDownloads.Enumerate(CancelAllDownloads, this); mCurrDownloads.Enumerate(CancelAllDownloads, this);
// Download Manager is shutting down! Tell the XPInstallManager to stop
// transferring any files that may have been being downloaded.
gObserverService->NotifyObservers(mXPIProgress, "xpinstall-progress", NS_LITERAL_STRING("cancel").get());
// Now go and update the datasource so that we "cancel" all paused downloads. // Now go and update the datasource so that we "cancel" all paused downloads.
SaveState(); SaveState();