Bug 1319566 - Ensure all registered handles are cleared properly. r=padenot, a=gchang
authorRandell Jesup <rjesup@jesup.org>
Wed, 30 Nov 2016 18:25:53 -0500
changeset 352799 16b0b8d30804927c93c70dc7aee279f3a279f593
parent 352798 42b05ed4b81490ddfde1439c08d6861b791ad687
child 352800 1258309afc856df19a2ef82affceec98720e149d
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, gchang
bugs1319566
milestone52.0a2
Bug 1319566 - Ensure all registered handles are cleared properly. r=padenot, a=gchang
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -809,20 +809,21 @@ MediaEngineWebRTCMicrophoneSource::Shutd
       }
       Stop(source, kAudioTrack); // XXX change to support multiple tracks
     }
     MOZ_ASSERT(mState == kStopped);
   }
 
   while (mRegisteredHandles.Length()) {
     MOZ_ASSERT(mState == kAllocated || mState == kStopped);
-    Deallocate(nullptr); // XXX Extend concurrent constraints code to mics.
+    // on last Deallocate(), FreeChannel()s and DeInit()s if all channels are released
+    Deallocate(mRegisteredHandles[0].get());
   }
+  MOZ_ASSERT(mState == kReleased);
 
-  FreeChannel();
   mAudioInput = nullptr;
 }
 
 typedef int16_t sample;
 
 void
 MediaEngineWebRTCMicrophoneSource::Process(int channel,
                                            webrtc::ProcessingTypes type,