diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-11-02 10:47:05 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-11-02 10:47:05 +0100 |
commit | 616c2beaf6f0efe6f49ec3ede52102927579d738 (patch) | |
tree | bd903612f46f95cac88f0bb89a4465005b0fbcbf | |
parent | 1583f38772f36862d0a40f2e4382306f87491cee (diff) | |
download | aura-central-616c2beaf6f0efe6f49ec3ede52102927579d738.tar.gz |
Make sure we remove our RefreshDriver observers in CompleteAsyncScroll.
Follow-up to fdbac095968bc952fec6a03765a7156940ae4733
-rw-r--r-- | layout/generic/nsGfxScrollFrame.cpp | 11 | ||||
-rw-r--r-- | layout/generic/nsGfxScrollFrame.h | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index cfa366aa3..3ed3b0bb3 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2152,8 +2152,7 @@ void ScrollFrameHelper::CompleteAsyncScroll(const nsRect &aRange, nsIAtom* aOrigin) { // Apply desired destination range since this is the last step of scrolling. - mAsyncSmoothMSDScroll = nullptr; - mAsyncScroll = nullptr; + RemoveObservers(); nsWeakFrame weakFrame(mOuter); ScrollToImpl(mDestination, aRange, aOrigin); if (!weakFrame.IsAlive()) { @@ -4588,11 +4587,19 @@ ScrollFrameHelper::Destroy() mScrollActivityTimer->Cancel(); mScrollActivityTimer = nullptr; } + RemoveObservers(); +} + +void +ScrollFrameHelper::RemoveObservers() +{ if (mAsyncScroll) { mAsyncScroll->RemoveObserver(); + mAsyncScroll = nullptr; } if (mAsyncSmoothMSDScroll) { mAsyncSmoothMSDScroll->RemoveObserver(); + mAsyncSmoothMSDScroll = nullptr; } } diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index f1ef44ae8..81bbb358f 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -638,6 +638,9 @@ protected: bool HasBgAttachmentLocal() const; uint8_t GetScrolledFrameDir() const; + // Removes any RefreshDriver observers we might have registered. + void RemoveObservers(); + static void EnsureFrameVisPrefsCached(); static bool sFrameVisPrefsCached; // The number of scrollports wide/high to expand when tracking frame visibility. |