Bug 1280445 - Don't hold on to Image in MediaEngineDefaultVideoSource after Stop(). r=pehrsons
authorRandell Jesup <rjesup@jesup.org>
Thu, 16 Jun 2016 12:46:26 +0100
changeset 303636 606dc72f3a621df6b1ee8a64fc4b8ce603aee04a
parent 303635 66dc5a74603aae9813d39b6cc1a16ece33fca459
child 303637 5fa9c9c4260d3e02c1e7b0a4e2390a77f88583c2
push id79133
push userpehrsons@gmail.com
push dateTue, 05 Jul 2016 09:26:07 +0000
treeherdermozilla-inbound@750df2678990 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1280445
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1280445 - Don't hold on to Image in MediaEngineDefaultVideoSource after Stop(). r=pehrsons MozReview-Commit-ID: K5NTMrbnAEi
dom/media/webrtc/MediaEngineDefault.cpp
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -110,16 +110,17 @@ MediaEngineDefaultVideoSource::Allocate(
 
 nsresult
 MediaEngineDefaultVideoSource::Deallocate()
 {
   if (mState != kStopped && mState != kAllocated) {
     return NS_ERROR_FAILURE;
   }
   mState = kReleased;
+  mImage = nullptr;
   return NS_OK;
 }
 
 static void AllocateSolidColorFrame(layers::PlanarYCbCrData& aData,
                                     int aWidth, int aHeight,
                                     int aY, int aCb, int aCr)
 {
   MOZ_ASSERT(!(aWidth&1));
@@ -203,16 +204,17 @@ MediaEngineDefaultVideoSource::Stop(Sour
   aSource->EndTrack(aID);
   if (mHasFakeTracks) {
     for (int i = 0; i < kFakeVideoTrackCount; ++i) {
       aSource->EndTrack(kTrackCount + i);
     }
   }
 
   mState = kStopped;
+  mImage = nullptr;
   return NS_OK;
 }
 
 nsresult
 MediaEngineDefaultVideoSource::Restart(const dom::MediaTrackConstraints& aConstraints,
                                        const MediaEnginePrefs &aPrefs,
                                        const nsString& aDeviceId)
 {