Bug 836599 - Part 5: Make MediaStreamGraphImpl::RunInStableState not assume that it's the only graph; r=roc

This commit is contained in:
Ehsan Akhgari 2013-02-04 12:27:54 -05:00
parent 076bf1509f
commit cf993195fa

View File

@ -1218,11 +1218,13 @@ MediaStreamGraphImpl::RunInStableState()
if (mCurrentTaskMessageQueue.IsEmpty()) {
if (mLifecycleState == LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP && IsEmpty()) {
NS_ASSERTION(gGraph == this, "Not current graph??");
// Complete shutdown. First, ensure that this graph is no longer used.
// A new graph graph will be created if one is needed.
LOG(PR_LOG_DEBUG, ("Disconnecting MediaStreamGraph %p", gGraph));
gGraph = nullptr;
LOG(PR_LOG_DEBUG, ("Disconnecting MediaStreamGraph %p", this));
if (this == gGraph) {
// null out gGraph if that's the graph being shut down
gGraph = nullptr;
}
// Asynchronously clean up old graph. We don't want to do this
// synchronously because it spins the event loop waiting for threads
// to shut down, and we don't want to do that in a stable state handler.