Commit 126709f5 authored by Andreas Pehrson's avatar Andreas Pehrson
Browse files

Bug 1795542b - Allow capture requests to resolve while waiting for disconnect. r=mjf

Immediately shutting down the TaskQueue would result in assertion failures if
a request resolves before being disconnected from its handler.

Differential Revision: https://phabricator.services.mozilla.com/D159604
parent c7b43afe
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -81,11 +81,11 @@ TabCapturerWebrtc::~TabCapturerWebrtc() {
        for (const auto& req : mRequests) {
          req->Disconnect();
        }
      })));
        mMainThreadWorker->BeginShutdown();
      })));
  // Block until the worker has run all pending tasks, since mCallback must
  // outlive them, and libwebrtc only guarantees mCallback outlives us.
  mMainThreadWorker->AwaitIdle();
  mMainThreadWorker->AwaitShutdownAndIdle();
}

bool TabCapturerWebrtc::GetSourceList(