mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Bug 1470260 - Part 1: Ensure that 'this' stays alive for the duration of the TickRefreshDriver call.
This commit is contained in:
parent
38a520c28a
commit
6f120a942c
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue