Bug 1624458: Make sure we cancel callbacks in close. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 24 Mar 2020 16:19:42 +0000
changeset 520261 39247c9ce4fc059e78107e2ef49dd55b52727d2e
parent 520260 155281fd18fd0ca2bd27e5d8ceb583cf10055a22
child 520262 24568b324c27ede4a89278ee7875b4db891e03d7
push id37246
push useropoprus@mozilla.com
push dateWed, 25 Mar 2020 03:40:33 +0000
treeherdermozilla-central@14b59d4adc95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1624458
milestone76.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 1624458: Make sure we cancel callbacks in close. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D68042
media/mtransport/nr_socket_prsock.cpp
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -839,16 +839,18 @@ int NrSocket::getaddr(nr_transport_addr*
   ASSERT_ON_THREAD(ststhread_);
   return nr_transport_addr_copy(addrp, &my_addr_);
 }
 
 // Close the socket so that the STS will detach and then kill it
 void NrSocket::close() {
   ASSERT_ON_THREAD(ststhread_);
   mCondition = NS_BASE_STREAM_CLOSED;
+  cancel(NR_ASYNC_WAIT_READ);
+  cancel(NR_ASYNC_WAIT_WRITE);
 }
 
 int NrSocket::connect(nr_transport_addr* addr) {
   ASSERT_ON_THREAD(ststhread_);
   int r, _status;
   PRNetAddr naddr;
   int32_t connect_status, getsockname_status;