mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 23:37:31 +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
|
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()) {
|
if (!NS_IsMainThread()) {
|
||||||
MOZ_ASSERT(XRE_IsParentProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
// Compress vsync notifications such that only 1 may run at a time
|
// Compress vsync notifications such that only 1 may run at a time
|
||||||
|
|
@ -498,6 +501,7 @@ private:
|
||||||
aVsyncTimestamp);
|
aVsyncTimestamp);
|
||||||
NS_DispatchToMainThread(vsyncEvent);
|
NS_DispatchToMainThread(vsyncEvent);
|
||||||
} else {
|
} else {
|
||||||
|
RefPtr<RefreshDriverVsyncObserver> kungFuDeathGrip(this);
|
||||||
TickRefreshDriver(aVsyncTimestamp);
|
TickRefreshDriver(aVsyncTimestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue