Bug 1075199 - Extend lifetime of VideoHost in GMPVideoDecoderParent to stop its destruction racing with the deallocation of video buffers - r=jesup a=lmandel
authorEdwin Flores <edwin@mozilla.com>
Fri, 16 Jan 2015 11:04:03 +1300
changeset 250193 ed78f124783d
parent 250192 8fb0193c1399
child 250194 c197f7371955
push id4521
push usercpearce@mozilla.com
push date2015-03-04 01:22 +0000
treeherdermozilla-beta@8abdbdecd2d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lmandel
bugs1075199
milestone37.0
Bug 1075199 - Extend lifetime of VideoHost in GMPVideoDecoderParent to stop its destruction racing with the deallocation of video buffers - r=jesup a=lmandel
dom/media/gmp/GMPVideoDecoderParent.cpp
--- a/dom/media/gmp/GMPVideoDecoderParent.cpp
+++ b/dom/media/gmp/GMPVideoDecoderParent.cpp
@@ -194,29 +194,30 @@ GMPVideoDecoderParent::Shutdown()
   }
   mShuttingDown = true;
 
   // Notify client we're gone!  Won't occur after Close()
   if (mCallback) {
     mCallback->Terminated();
     mCallback = nullptr;
   }
-  mVideoHost.DoneWithAPI();
 
   mIsOpen = false;
   unused << SendDecodingComplete();
 
   return NS_OK;
 }
 
 // Note: Keep this sync'd up with Shutdown
 void
 GMPVideoDecoderParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   mIsOpen = false;
+  mVideoHost.DoneWithAPI();
+
   if (mCallback) {
     // May call Close() (and Shutdown()) immediately or with a delay
     mCallback->Terminated();
     mCallback = nullptr;
   }
   if (mPlugin) {
     // Ignore any return code. It is OK for this to fail without killing the process.
     mPlugin->VideoDecoderDestroyed(this);