Bug 1163132 - crash in nsMsgFilterAfterTheFact::ContinueExecutionPrompt(), r=neil, a=rkent THUNDERBIRD_38_VERBRANCH
authorR Kent James <rkent@caspia.com>
Wed, 13 May 2015 15:35:10 -0700
branchTHUNDERBIRD_38_VERBRANCH
changeset 26022 ce7bee323287f087062d8a2c291d1dc6a92028bf
parent 26021 704add71dcf18d0a35f7b62a2eaacb2967954d20
child 26023 87ec3c0eb3f0a9a2aec1f85f425e5174ac94a69f
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, rkent
bugs1163132
Bug 1163132 - crash in nsMsgFilterAfterTheFact::ContinueExecutionPrompt(), r=neil, a=rkent
mailnews/base/search/src/nsMsgFilterService.cpp
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -897,17 +897,18 @@ NS_IMETHODIMP
 nsMsgFilterService::ApplyFiltersToFolders(nsIMsgFilterList *aFilterList,
                                           nsIArray *aFolders,
                                           nsIMsgWindow *aMsgWindow,
                                           nsIMsgOperationListener *aCallback)
 {
   NS_ENSURE_ARG_POINTER(aFilterList);
   NS_ENSURE_ARG_POINTER(aFolders);
 
-  nsMsgFilterAfterTheFact *filterExecutor = new nsMsgFilterAfterTheFact(aMsgWindow, aFilterList, aFolders, aCallback);
+  nsRefPtr<nsMsgFilterAfterTheFact> filterExecutor =
+    new nsMsgFilterAfterTheFact(aMsgWindow, aFilterList, aFolders, aCallback);
   if (filterExecutor)
     return filterExecutor->AdvanceToNextFolder();
   else
     return NS_ERROR_OUT_OF_MEMORY;
 }
 
 NS_IMETHODIMP nsMsgFilterService::AddCustomAction(nsIMsgFilterCustomAction *aAction)
 {
@@ -1097,18 +1098,19 @@ NS_IMETHODIMP nsMsgFilterService::ApplyF
 
   nsCOMPtr<nsIMutableArray> folderList(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   folderList->AppendElement(aFolder, false);
 
   // Create our nsMsgApplyFiltersToMessages object which will be called when ApplyFiltersToHdr
   // finds one or more filters that hit.
-  nsMsgApplyFiltersToMessages * filterExecutor = new nsMsgApplyFiltersToMessages
-      (aMsgWindow, filterList, folderList, aMsgHdrList, aFilterType, aCallback);
+  nsRefPtr<nsMsgApplyFiltersToMessages> filterExecutor =
+    new nsMsgApplyFiltersToMessages(aMsgWindow, filterList, folderList,
+                                    aMsgHdrList, aFilterType, aCallback);
 
   if (filterExecutor)
     return filterExecutor->AdvanceToNextFolder();
 
   return NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* void OnStartCopy (); */