Backed out changeset 443a94083e00 (bug 1294605)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Oct 2016 20:03:16 +0200
changeset 427695 b82347df2602f07c7b190f0fbf7a6991d6022044
parent 427694 40fb588cb1bc706a9c86dd5a27442714bd236afb
child 427696 387012235302ccb073180d17ecea6e0d794dfcb3
push id33099
push userdholbert@mozilla.com
push dateThu, 20 Oct 2016 20:25:54 +0000
bugs1294605
milestone52.0a1
backs out443a94083e005ad58574d3571be3299ffc6d8029
Backed out changeset 443a94083e00 (bug 1294605)
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2205,21 +2205,25 @@ public:
                                            MediaStreamTrackSource)
 
   explicit StreamCaptureTrackSource(MediaStreamTrackSource* aCapturedTrackSource)
     : MediaStreamTrackSource(aCapturedTrackSource->GetPrincipal(),
                              true,
                              nsString())
     , mCapturedTrackSource(aCapturedTrackSource)
   {
+    mCapturedTrackSource->RegisterSink(this);
   }
 
   void Destroy() override
   {
     MOZ_ASSERT(mCapturedTrackSource);
+    if (mCapturedTrackSource) {
+      mCapturedTrackSource->UnregisterSink(this);
+    }
   }
 
   MediaSourceEnum GetMediaSource() const override
   {
     return MediaSourceEnum::Other;
   }
 
   CORSMode GetCORSMode() const override