зеркало из 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)
|
||||
: mHelper(aHelper)
|
||||
{
|
||||
mHelper->mOuter->PresContext()->RefreshDriver()->AddRefreshObserver(this, Flush_Style);
|
||||
mDriver = mHelper->mOuter->PresContext()->RefreshDriver();
|
||||
mDriver->AddRefreshObserver(this, Flush_Style);
|
||||
}
|
||||
|
||||
ScrollFrameHelper::ScrollEvent::~ScrollEvent()
|
||||
{
|
||||
mHelper->mOuter->PresContext()->RefreshDriver()->RemoveRefreshObserver(this, Flush_Style);
|
||||
mDriver->RemoveRefreshObserver(this, Flush_Style);
|
||||
mDriver = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -111,6 +111,7 @@ public:
|
|||
virtual ~ScrollEvent();
|
||||
private:
|
||||
ScrollFrameHelper *mHelper;
|
||||
RefPtr<nsRefreshDriver> mDriver;
|
||||
};
|
||||
|
||||
class AsyncScrollPortEvent : public nsRunnable {
|
||||
|
|
Загрузка…
Ссылка в новой задаче