From 8c9b42d0b95bafd3e4dacdc1ab21af4066cfcbd9 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Fri, 13 Jan 2017 13:54:20 -0500 Subject: Bug 1452416 - Release GraphDrivers outside of StableState runnable to avoid spinning the event queue. r=smaug, r=padenot, a=RyanVM --HG-- extra : source : c90ec782d481f05f5848f171a945cfc5bcf5b0ca --- dom/media/MediaStreamGraph.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dom/media/MediaStreamGraph.cpp') diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index 94cafa029..e2934cbb2 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -1715,6 +1715,10 @@ MediaStreamGraphImpl::RunInStableState(bool aSourceIsMSG) RefPtr driver = CurrentDriver(); MonitorAutoUnlock unlock(mMonitor); driver->Start(); + // It's not safe to Shutdown() a thread from StableState, and + // releasing this may shutdown a SystemClockDriver thread. + // Proxy the release to outside of StableState. + NS_ReleaseOnMainThread(driver.forget(), true); // always proxy } } -- cgit v1.2.3