зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1234242 - Keep a RefPtr to the refresh driver to unregister the ScrollEvent, rather than relying on a chain of pointers remaining non-null. r=mstange a=KWierso
--HG-- extra : commitid : JouJUWdzJl6
This commit is contained in:
Родитель
956117e0df
Коммит
4a4a0bcf45
|
@ -4228,12 +4228,14 @@ void ScrollFrameHelper::CurPosAttributeChanged(nsIContent* aContent)
|
||||||
ScrollFrameHelper::ScrollEvent::ScrollEvent(ScrollFrameHelper* aHelper)
|
ScrollFrameHelper::ScrollEvent::ScrollEvent(ScrollFrameHelper* aHelper)
|
||||||
: mHelper(aHelper)
|
: mHelper(aHelper)
|
||||||
{
|
{
|
||||||
mHelper->mOuter->PresContext()->RefreshDriver()->AddRefreshObserver(this, Flush_Style);
|
mDriver = mHelper->mOuter->PresContext()->RefreshDriver();
|
||||||
|
mDriver->AddRefreshObserver(this, Flush_Style);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollFrameHelper::ScrollEvent::~ScrollEvent()
|
ScrollFrameHelper::ScrollEvent::~ScrollEvent()
|
||||||
{
|
{
|
||||||
mHelper->mOuter->PresContext()->RefreshDriver()->RemoveRefreshObserver(this, Flush_Style);
|
mDriver->RemoveRefreshObserver(this, Flush_Style);
|
||||||
|
mDriver = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -111,6 +111,7 @@ public:
|
||||||
virtual ~ScrollEvent();
|
virtual ~ScrollEvent();
|
||||||
private:
|
private:
|
||||||
ScrollFrameHelper *mHelper;
|
ScrollFrameHelper *mHelper;
|
||||||
|
RefPtr<nsRefreshDriver> mDriver;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AsyncScrollPortEvent : public nsRunnable {
|
class AsyncScrollPortEvent : public nsRunnable {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче