mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 22:08:40 +09:00
Bug 1339588 - Part 1: Simplify nsTimerEvent::Cancel, since there's no need to release the nsTimerImpl itself. r=froydnj, a=dveditz
This commit is contained in:
parent
f43ff83d54
commit
c72a393b93
1 changed files with 2 additions and 13 deletions
|
|
@ -140,11 +140,7 @@ public:
|
|||
|
||||
nsresult Cancel() override
|
||||
{
|
||||
// Since nsTimerImpl is not thread-safe, we should release |mTimer|
|
||||
// here in the target thread to avoid race condition. Otherwise,
|
||||
// ~nsTimerEvent() which calls nsTimerImpl::Release() could run in the
|
||||
// timer thread and result in race condition.
|
||||
mTimer = nullptr;
|
||||
mTimer->Cancel();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
@ -269,11 +265,6 @@ nsTimerEvent::DeleteAllocatorIfNeeded()
|
|||
NS_IMETHODIMP
|
||||
nsTimerEvent::Run()
|
||||
{
|
||||
if (!mTimer) {
|
||||
MOZ_ASSERT(false);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (MOZ_LOG_TEST(GetTimerLog(), LogLevel::Debug)) {
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
MOZ_LOG(GetTimerLog(), LogLevel::Debug,
|
||||
|
|
@ -283,9 +274,7 @@ nsTimerEvent::Run()
|
|||
|
||||
mTimer->Fire(mGeneration);
|
||||
|
||||
// We call Cancel() to correctly release mTimer.
|
||||
// Read more in the Cancel() implementation.
|
||||
return Cancel();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue