Bug 1346681 - Label runnables in dom/media/gmp/GMPVideoEncoderParent.cpp. r?jesup
MozReview-Commit-ID: GZqomJdBKxB
--- a/dom/media/gmp/GMPVideoEncoderParent.cpp
+++ b/dom/media/gmp/GMPVideoEncoderParent.cpp
@@ -252,19 +252,19 @@ GMPVideoEncoderParent::ActorDestroy(Acto
if (mCallback) {
// May call Close() (and Shutdown()) immediately or with a delay
mCallback->Terminated();
mCallback = nullptr;
}
// Must be shut down before VideoEncoderDestroyed(), since this can recurse
// the GMPThread event loop. See bug 1049501
if (mEncodedThread) {
- NS_DispatchToMainThread(
- WrapRunnableNM(&ShutdownEncodedThread, nsCOMPtr<nsIThread>(mEncodedThread))
- );
+ nsCOMPtr<nsIRunnable> r = WrapRunnableNM(
+ &ShutdownEncodedThread, nsCOMPtr<nsIThread>(mEncodedThread));
+ SystemGroup::Dispatch("ShutdownEncodedThread", TaskCategory::Other, r.forget());
mEncodedThread = nullptr;
}
if (mPlugin) {
// Ignore any return code. It is OK for this to fail without killing the process.
mPlugin->VideoEncoderDestroyed(this);
mPlugin = nullptr;
}
mVideoHost.ActorDestroyed(); // same as DoneWithAPI