Bug 713172 - Followup to finalize statements instead of nulling them out. r=mak
authorJosh Matthews <josh@joshmatthews.net>
Wed, 11 Jan 2012 17:13:49 -0500
changeset 85538 5a020d632a28369edb00723753c404c7ed912702
parent 85537 0f7291d2316d369fea3d97d28109188818b735f6
child 85539 ae61a309be6917a76506532bc2f079c60063f464
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs713172
milestone12.0a1
Bug 713172 - Followup to finalize statements instead of nulling them out. r=mak
toolkit/components/downloads/nsDownloadManager.cpp
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -1938,19 +1938,18 @@ nsDownloadManager::Observe(nsISupports *
     NS_ENSURE_SUCCESS(rv, rv);
 
     PRUint32 id;
     dl->GetId(&id);
     nsDownload *dl2 = FindDownload(id);
     if (dl2)
       return CancelDownload(id);
   } else if (strcmp(aTopic, "profile-before-change") == 0) {
-    // Null statements to finalize them.
-    mGetIdsForURIStatement = nsnull;
-    mUpdateDownloadStatement = nsnull;
+    mGetIdsForURIStatement->Finalize();
+    mUpdateDownloadStatement->Finalize();
     mozilla::DebugOnly<nsresult> rv = mDBConn->Close();
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   } else if (strcmp(aTopic, "quit-application") == 0) {
     // Try to pause all downloads and, if appropriate, mark them as auto-resume
     // unless user has specified that downloads should be canceled
     enum QuitBehavior behavior = GetQuitBehavior();
     if (behavior != QUIT_AND_CANCEL)
       (void)PauseAllDownloads(bool(behavior != QUIT_AND_PAUSE));