Bug 1356516 - Close channel before destroying GMPServiceChild - r=billm draft
authorGerald Squelart <gsquelart@mozilla.com>
Wed, 19 Apr 2017 15:48:32 +1200
changeset 564967 2a927bb06dd8fb4f1114dc0b64025cbdddc7c133
parent 564706 3f9f6d6086b2d247831d1d03d530095bebd5a6b2
child 624864 e571d9545052e7ac3c26f74f4b7709b7d4a814ae
push id54730
push usergsquelart@mozilla.com
push dateWed, 19 Apr 2017 06:34:54 +0000
reviewersbillm
bugs1356516
milestone55.0a1
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
dom/media/gmp/GMPServiceChild.cpp
--- 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()
 {
 }