Bug 1163132 - crash in nsMsgFilterAfterTheFact::ContinueExecutionPrompt(), r=neil, a=rkent
authorR Kent James <rkent@caspia.com>
Wed, 13 May 2015 15:35:10 -0700
changeset 26129 c66ae8a4029edf70e60743a80d753d95cb4f5dd1
parent 26128 5973695cf4b114df962944b3bdc6dd619a6ed133
child 26130 6198c32a74f7018c8019fd79aeb04db5abe2b533
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 (); */