diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc b/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc index 636aa342529..be9196ee034 100644 --- a/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc +++ b/chromium/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc @@ -893,12 +893,18 @@ RTCPeerConnection::~RTCPeerConnection() { } void RTCPeerConnection::Dispose() { - // Promptly clears the handler - // so that content/ doesn't access it in a lazy sweeping phase. - // Other references to the handler use a weak pointer, preventing access. + // Promptly clears the handler so that content doesn't access it in a lazy + // sweeping phase. Other references to the handler use a weak pointer, + // preventing access. if (peer_handler_) { peer_handler_.reset(); } + // Memory owned by RTCPeerConnection must not be touched after Dispose(). + // Shut down the cache to cancel any in-flight tasks that may otherwise have + // used the cache. + if (rtp_contributing_source_cache_.has_value()) { + rtp_contributing_source_cache_.value().Shutdown(); + } } ScriptPromise RTCPeerConnection::createOffer(ScriptState* script_state, |