Bug 1109216 - Chain MediaOmxReader::ReleaseDecoder off MediaDecoderReader::Shutdown resolution. r=cpearce

This commit is contained in:
Bobby Holley 2014-12-12 14:22:29 -08:00
parent da72b3891c
commit f99391c4c3

View File

@ -184,9 +184,11 @@ MediaOmxReader::Shutdown()
nsRefPtr<ShutdownPromise> p = MediaDecoderReader::Shutdown();
nsCOMPtr<nsIRunnable> event =
NS_NewRunnableMethod(this, &MediaOmxReader::ReleaseDecoder);
NS_DispatchToMainThread(event);
// Wait for the superclass to finish tearing things down before releasing
// the decoder on the main thread.
nsCOMPtr<nsIThread> mt;
NS_GetMainThread(getter_AddRefs(mt));
p->Then(mt.get(), __func__, this, &MediaOmxReader::ReleaseDecoder, &MediaOmxReader::ReleaseDecoder);
return p;
}