Bug 1310925: Acquire a reference before unlocking, just in case. r=froydnj
MozReview-Commit-ID: BLExeLU8AFs
--- a/xpcom/threads/TimerThread.cpp
+++ b/xpcom/threads/TimerThread.cpp
@@ -688,17 +688,17 @@ TimerThread::PostTimerEvent(already_AddR
#ifdef MOZ_TASK_TRACER
// During the dispatch of TimerEvent, we overwrite the current TraceInfo
// partially with the info saved in timer earlier, and restore it back by
// AutoSaveCurTraceInfo.
AutoSaveCurTraceInfo saveCurTraceInfo;
(timer->GetTracedTask()).SetTLSTraceInfo();
#endif
- nsIEventTarget* target = timer->mEventTarget;
+ nsCOMPtr<nsIEventTarget> target = timer->mEventTarget;
event->SetTimer(timer.forget());
nsresult rv;
{
// We release mMonitor around the Dispatch because if this timer is targeted
// at the TimerThread we'll deadlock.
MonitorAutoUnlock unlock(mMonitor);
rv = target->Dispatch(event, NS_DISPATCH_NORMAL);