Bug 1493347: Drop DataChannelListener on Destroy() r=drno
authorRandell Jesup <rjesup@jesup.org>
Mon, 01 Oct 2018 00:39:12 -0400
changeset 487262 4d0ca51d2c0ceb064db11e06782fb415b0ed2641
parent 487261 274e2637419e7fff7105b7060303f327b6df705a
child 487263 4e879c661c84d27e657d10425229232f9798c7cd
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersdrno
bugs1493347
milestone64.0a1
Bug 1493347: Drop DataChannelListener on Destroy() r=drno
netwerk/sctp/datachannel/DataChannel.cpp
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -371,16 +371,17 @@ DataChannelConnection::Destroy()
 
   MutexAutoLock lock(mLock);
   // If we had a pending reset, we aren't waiting for it - clear the list so
   // we can deregister this DataChannelConnection without leaking.
   ClearResets();
 
   MOZ_ASSERT(mSTS);
   ASSERT_WEBRTC(NS_IsMainThread());
+  mListener = nullptr;
   // Finish Destroy on STS thread to avoid bug 876167 - once that's fixed,
   // the usrsctp_close() calls can move back here (and just proxy the
   // disconnect_all())
   RUN_ON_THREAD(mSTS, WrapRunnable(RefPtr<DataChannelConnection>(this),
                                    &DataChannelConnection::DestroyOnSTS,
                                    mSocket, mMasterSocket),
                 NS_DISPATCH_NORMAL);