diff --git a/layout/style/nsAnimationManager.h b/layout/style/nsAnimationManager.h index 7a70683725dd..18769f26ce89 100644 --- a/layout/style/nsAnimationManager.h +++ b/layout/style/nsAnimationManager.h @@ -313,7 +313,11 @@ public: * accumulate animationstart events at other points when style * contexts are created. */ - void DispatchEvents() { mEventDispatcher.DispatchEvents(mPresContext); } + void DispatchEvents() + { + RefPtr kungFuDeathGrip(this); + mEventDispatcher.DispatchEvents(mPresContext); + } void SortEvents() { mEventDispatcher.SortEvents(); } void ClearEventQueue() { mEventDispatcher.ClearEventQueue(); } diff --git a/layout/style/nsTransitionManager.h b/layout/style/nsTransitionManager.h index 65a68771c260..35c627af82b2 100644 --- a/layout/style/nsTransitionManager.h +++ b/layout/style/nsTransitionManager.h @@ -306,7 +306,11 @@ public: mozilla::Forward(aEventInfo)); } - void DispatchEvents() { mEventDispatcher.DispatchEvents(mPresContext); } + void DispatchEvents() + { + RefPtr kungFuDeathGrip(this); + mEventDispatcher.DispatchEvents(mPresContext); + } void SortEvents() { mEventDispatcher.SortEvents(); } void ClearEventQueue() { mEventDispatcher.ClearEventQueue(); }