Bug 711536 - finalize statements and close connection. r=mak.

This commit is contained in:
Rafael Ávila de Espíndola 2011-12-19 13:55:08 -05:00
parent a935fc3ed1
commit d115351db1

View File

@ -1951,6 +1951,12 @@ nsDownloadManager::Observe(nsISupports *aSubject,
// aborted downloads if the user's retention policy specifies it.
if (GetRetentionBehavior() == 1)
CleanUp();
// Null statements to finalize them.
mGetIdsForURIStatement = nsnull;
mUpdateDownloadStatement = nsnull;
mozilla::DebugOnly<nsresult> rv = mDBConn->Close();
MOZ_ASSERT(NS_SUCCEEDED(rv));
} else if (strcmp(aTopic, "quit-application-requested") == 0 &&
currDownloadCount) {
nsCOMPtr<nsISupportsPRBool> cancelDownloads =