Bug 997908 - Add null check to ReleaseSliceNow() as bandaid for Mac topcrasher. r=smaug
authorSteven Michaud <smichaud@pobox.com>
Thu, 24 Apr 2014 11:46:39 -0500
changeset 198549 bace819903bbea609cbab39ccc26364ac3bb64ec
parent 198548 114a84c729dbf3be661d64405260fc6cda67e282
child 198550 5a0136e2cc357a4002328f781b8dc8cf8e894a94
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs997908
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 997908 - Add null check to ReleaseSliceNow() as bandaid for Mac topcrasher. r=smaug
xpcom/base/CycleCollectedJSRuntime.cpp
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -1000,17 +1000,17 @@ ReleaseSliceNow(uint32_t aSlice, void* a
   uint32_t length = items->Length();
   aSlice = std::min(aSlice, length);
   for (uint32_t i = length; i > length - aSlice; --i) {
     // Remove (and NS_RELEASE) the last entry in "items":
     uint32_t lastItemIdx = i - 1;
 
     nsISupports* wrapper = items->ElementAt(lastItemIdx);
     items->RemoveElementAt(lastItemIdx);
-    NS_RELEASE(wrapper);
+    NS_IF_RELEASE(wrapper);
   }
 
   return items->IsEmpty();
 }
 
 /* static */ PLDHashOperator
 IncrementalFinalizeRunnable::DeferredFinalizerEnumerator(DeferredFinalizeFunction& aFunction,
                                                          void*& aData,