Bug 1300211 - Trace XULDocument::mCurrentPrototype. r=smaug draft
authorAndrew McCreight <continuation@gmail.com>
Thu, 08 Sep 2016 15:14:28 -0700
changeset 412317 dc0354ac6a9b2674d2cdd6328afc9e93119d9717
parent 412301 fbeb02a66f11db028d36f22510b5d669cbd4ca85
child 530943 5f674e7cfe633af4a37bbd2a91e5d5dd71453eda
push id29128
push userbmo:continuation@gmail.com
push dateFri, 09 Sep 2016 20:57:49 +0000
reviewerssmaug
bugs1300211
milestone51.0a1
Bug 1300211 - Trace XULDocument::mCurrentPrototype. r=smaug This ensures that if mCurrentPrototype gets added to mPrototypes, it won't go from gray to black. MozReview-Commit-ID: 7PyZEa1kpt6
dom/xul/XULDocument.cpp
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -2155,16 +2155,20 @@ XULDocument::ApplyPersistentAttributesTo
 
 void
 XULDocument::TraceProtos(JSTracer* aTrc, uint32_t aGCNumber)
 {
     uint32_t i, count = mPrototypes.Length();
     for (i = 0; i < count; ++i) {
         mPrototypes[i]->TraceProtos(aTrc, aGCNumber);
     }
+
+    if (mCurrentPrototype) {
+        mCurrentPrototype->TraceProtos(aTrc, aGCNumber);
+    }
 }
 
 //----------------------------------------------------------------------
 //
 // XULDocument::ContextStack
 //
 
 XULDocument::ContextStack::ContextStack()