summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-09-10 22:12:07 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-09-10 22:12:07 +0200
commitc70fbd4e75e0829c62fa5f7f9ce7e873b880007e (patch)
tree557acf70c9ceb55f2ebe0efc743ea585dfa1dbb7
parentff53b03a711e262d1996b700305828b46f64ed66 (diff)
downloaduxp-c70fbd4e75e0829c62fa5f7f9ce7e873b880007e.tar.gz
Bug 1470260 - Part 1: Ensure that 'this' stays alive for the duration of the TickRefreshDriver call.
-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 bc1a27852b..8a62b517e9 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);
}