Backed out changeset 443a94083e00 (bug 1294605)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Oct 2016 20:03:16 +0200
changeset 427769 a8ae71a79bb863191d10a98eef33f3ffe95a47fb
parent 427768 f5feb30dd1755df0eafe2107df5f91426f8833f9
child 427770 16813ed5122558a0c6fc0609a9598df8cc7b4737
push id33111
push userbmo:poirot.alex@gmail.com
push dateThu, 20 Oct 2016 21:28:50 +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