Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions; r=dholbert a=gchang
authorBrian Birtles <birtles@gmail.com>
Tue, 21 Mar 2017 08:47:46 +0900
changeset 375365 476badc4efc53d59c3b54de7516d36aec80ca661
parent 375364 eb8eade361cb7a9b41dde9c2c93fb851186e695d
child 375366 b103de790ae97f1b64e5c5117c4de99928d40204
push id10929
push usercbook@mozilla.com
push dateWed, 22 Mar 2017 08:47:51 +0000
treeherdermozilla-aurora@908962e98a39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, gchang
bugs1347168
milestone54.0a2
Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions; r=dholbert a=gchang MozReview-Commit-ID: 1SH546Iu2FK
dom/smil/nsSMILAnimationController.cpp
--- a/dom/smil/nsSMILAnimationController.cpp
+++ b/dom/smil/nsSMILAnimationController.cpp
@@ -380,23 +380,26 @@ nsSMILAnimationController::DoSample(bool
   // their animation effects removed in sample 'n').
   //
   // Parts (i) and (ii) are not functionally related but we combine them here to
   // save iterating over the animation elements twice.
 
   // Create the compositor table
   nsAutoPtr<nsSMILCompositorTable>
     currentCompositorTable(new nsSMILCompositorTable(0));
+  nsTArray<RefPtr<SVGAnimationElement>>
+    animElems(mAnimationElementTable.Count());
 
   for (auto iter = mAnimationElementTable.Iter(); !iter.Done(); iter.Next()) {
     SVGAnimationElement* animElem = iter.Get()->GetKey();
     SampleTimedElement(animElem, &activeContainers);
     AddAnimationToCompositorTable(animElem,
                                   currentCompositorTable,
                                   isStyleFlushNeeded);
+    animElems.AppendElement(animElem);
   }
   activeContainers.Clear();
 
   // STEP 4: Compare previous sample's compositors against this sample's.
   // (Transfer cached base values across, & remove animation effects from
   // no-longer-animated targets.)
   if (mLastCompositorTable) {
     // * Transfer over cached base values, from last sample's compositors