Bug 1356516 - Close channel before destroying GMPServiceChild - r=billm
mServiceChild is a UniquePtr, so nulling it will destroy the GMPServiceChild,
which will destroy the associated message channel. So we need to close the
channel first before it gets destroyed. (Just as it was correctly done in
Observe() above.)
MozReview-Commit-ID: INuHN2Is7bC
--- a/dom/media/gmp/GMPServiceChild.cpp
+++ b/dom/media/gmp/GMPServiceChild.cpp
@@ -421,16 +421,17 @@ GeckoMediaPluginServiceChild::SetService
void
GeckoMediaPluginServiceChild::RemoveGMPContentParent(GMPContentParent* aGMPContentParent)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
if (mServiceChild) {
mServiceChild->RemoveGMPContentParent(aGMPContentParent);
if (mShuttingDownOnGMPThread && !mServiceChild->HaveContentParents()) {
+ mServiceChild->Close();
mServiceChild = nullptr;
}
}
}
GMPServiceChild::GMPServiceChild()
{
}