Bug 1184807 - better management of the dispatching of events when shutting down, r=rjesup

This commit is contained in:
Andrea Marchesini 2015-08-20 19:54:50 +01:00
parent 9de100cf73
commit 254bfbb384

View File

@ -194,8 +194,11 @@ TextTrackList::CreateAndDispatchTrackEventRunner(TextTrack* aTrack,
TrackEvent::Constructor(this, aEventName, eventInit); TrackEvent::Constructor(this, aEventName, eventInit);
// Dispatch the TrackEvent asynchronously. // Dispatch the TrackEvent asynchronously.
nsCOMPtr<nsIRunnable> eventRunner = new TrackEventRunner(this, event); rv = thread->Dispatch(do_AddRef(new TrackEventRunner(this, event)),
NS_DispatchToMainThread(eventRunner); NS_DISPATCH_NORMAL);
// If we are shutting down this can file but it's still ok.
NS_WARN_IF(NS_FAILED(rv));
} }
HTMLMediaElement* HTMLMediaElement*