summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--layout/base/nsRefreshDriver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp
index bc1a27852..8a62b517e 100644
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -478,6 +478,9 @@ private:
bool NotifyVsync(TimeStamp aVsyncTimestamp) override
{
+ // IMPORTANT: All paths through this method MUST hold a strong ref on
+ // |this| for the duration of the TickRefreshDriver callback.
+
if (!NS_IsMainThread()) {
MOZ_ASSERT(XRE_IsParentProcess());
// Compress vsync notifications such that only 1 may run at a time
@@ -498,6 +501,7 @@ private:
aVsyncTimestamp);
NS_DispatchToMainThread(vsyncEvent);
} else {
+ RefPtr<RefreshDriverVsyncObserver> kungFuDeathGrip(this);
TickRefreshDriver(aVsyncTimestamp);
}