Bug 1097850 - ChildFinder::NoteNativeChild() should call CanSkip(). r=smaug
authorAndrew McCreight <continuation@gmail.com>
Fri, 12 Dec 2014 13:42:21 -0800
changeset 219593 86277cb58ad61ac0f307c3627249a053ea7f002a
parent 219592 11c2074d527554378f2bf2eadedd1246cd57c5a1
child 219594 5cdf2a9449a5bad6f547147cb020c031747b28ce
push idunknown
push userunknown
push dateunknown
reviewerssmaug
bugs1097850
milestone37.0a1
Bug 1097850 - ChildFinder::NoteNativeChild() should call CanSkip(). r=smaug
xpcom/base/nsCycleCollector.cpp
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2444,17 +2444,21 @@ ChildFinder::NoteXPCOMChild(nsISupports*
     mMayHaveChild = true;
   }
 }
 
 NS_IMETHODIMP_(void)
 ChildFinder::NoteNativeChild(void* aChild,
                              nsCycleCollectionParticipant* aHelper)
 {
-  if (aChild) {
+  if (!aChild) {
+    return;
+  }
+  MOZ_ASSERT(aHelper, "Native child must have a participant");
+  if (!aHelper->CanSkip(aChild, true)) {
     mMayHaveChild = true;
   }
 }
 
 NS_IMETHODIMP_(void)
 ChildFinder::NoteJSChild(void* aChild)
 {
   if (aChild && xpc_GCThingIsGrayCCThing(aChild)) {