Bug 1310925: Acquire a reference before unlocking, just in case. r=froydnj draft
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 18 Oct 2016 09:42:13 -0500
changeset 427141 f5103a955f21a9f1bdf52130b4e061b5904bea5f
parent 426483 01ab78dd98805e150b0311cce2351d5b408f3001
child 534394 405bc76f8897679e274cd148954afc92cfaf5e1d
push id32937
push userbcampen@mozilla.com
push dateWed, 19 Oct 2016 21:12:07 +0000
reviewersfroydnj
bugs1310925
milestone52.0a1
Bug 1310925: Acquire a reference before unlocking, just in case. r=froydnj MozReview-Commit-ID: BLExeLU8AFs
xpcom/threads/TimerThread.cpp
--- 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);