mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 22:57:31 +09:00
Make sure we remove our RefreshDriver observers in CompleteAsyncScroll.
Follow-up to fdbac095968bc952fec6a03765a7156940ae4733
This commit is contained in:
parent
930cc1db3b
commit
bf30898e2c
2 changed files with 12 additions and 2 deletions
|
|
@ -2152,8 +2152,7 @@ void
|
||||||
ScrollFrameHelper::CompleteAsyncScroll(const nsRect &aRange, nsIAtom* aOrigin)
|
ScrollFrameHelper::CompleteAsyncScroll(const nsRect &aRange, nsIAtom* aOrigin)
|
||||||
{
|
{
|
||||||
// Apply desired destination range since this is the last step of scrolling.
|
// Apply desired destination range since this is the last step of scrolling.
|
||||||
mAsyncSmoothMSDScroll = nullptr;
|
RemoveObservers();
|
||||||
mAsyncScroll = nullptr;
|
|
||||||
nsWeakFrame weakFrame(mOuter);
|
nsWeakFrame weakFrame(mOuter);
|
||||||
ScrollToImpl(mDestination, aRange, aOrigin);
|
ScrollToImpl(mDestination, aRange, aOrigin);
|
||||||
if (!weakFrame.IsAlive()) {
|
if (!weakFrame.IsAlive()) {
|
||||||
|
|
@ -4588,11 +4587,19 @@ ScrollFrameHelper::Destroy()
|
||||||
mScrollActivityTimer->Cancel();
|
mScrollActivityTimer->Cancel();
|
||||||
mScrollActivityTimer = nullptr;
|
mScrollActivityTimer = nullptr;
|
||||||
}
|
}
|
||||||
|
RemoveObservers();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ScrollFrameHelper::RemoveObservers()
|
||||||
|
{
|
||||||
if (mAsyncScroll) {
|
if (mAsyncScroll) {
|
||||||
mAsyncScroll->RemoveObserver();
|
mAsyncScroll->RemoveObserver();
|
||||||
|
mAsyncScroll = nullptr;
|
||||||
}
|
}
|
||||||
if (mAsyncSmoothMSDScroll) {
|
if (mAsyncSmoothMSDScroll) {
|
||||||
mAsyncSmoothMSDScroll->RemoveObserver();
|
mAsyncSmoothMSDScroll->RemoveObserver();
|
||||||
|
mAsyncSmoothMSDScroll = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -638,6 +638,9 @@ protected:
|
||||||
bool HasBgAttachmentLocal() const;
|
bool HasBgAttachmentLocal() const;
|
||||||
uint8_t GetScrolledFrameDir() const;
|
uint8_t GetScrolledFrameDir() const;
|
||||||
|
|
||||||
|
// Removes any RefreshDriver observers we might have registered.
|
||||||
|
void RemoveObservers();
|
||||||
|
|
||||||
static void EnsureFrameVisPrefsCached();
|
static void EnsureFrameVisPrefsCached();
|
||||||
static bool sFrameVisPrefsCached;
|
static bool sFrameVisPrefsCached;
|
||||||
// The number of scrollports wide/high to expand when tracking frame visibility.
|
// The number of scrollports wide/high to expand when tracking frame visibility.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue