[WebRTC] NetworkRTCProvider should stop the network thread from the main thread
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 21:02:25 +0000 (21:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Feb 2017 21:02:25 +0000 (21:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168972

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-28
Reviewed by Alex Christensen.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::close): Ensuring to stop the network thread from the main thread when provider is
getting closed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/webrtc/NetworkRTCProvider.cpp

index 6db36d1..f0c7631 100644 (file)
@@ -1,3 +1,14 @@
+2017-02-28  Youenn Fablet  <youenn@apple.com>
+
+        [WebRTC] NetworkRTCProvider should stop the network thread from the main thread
+        https://bugs.webkit.org/show_bug.cgi?id=168972
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+        (WebKit::NetworkRTCProvider::close): Ensuring to stop the network thread from the main thread when provider is
+        getting closed.
+
 2017-02-24  Matt Rajca  <mrajca@apple.com>
 
         Media: notify clients when autoplayed media ends without being paused
 2017-02-24  Matt Rajca  <mrajca@apple.com>
 
         Media: notify clients when autoplayed media ends without being paused
index 6ec1b53..99b6eb9 100644 (file)
@@ -65,6 +65,10 @@ void NetworkRTCProvider::close()
 
     callOnRTCNetworkThread([this]() {
         m_sockets.clear();
 
     callOnRTCNetworkThread([this]() {
         m_sockets.clear();
+        callOnMainThread([provider = makeRef(*this)]() {
+            if (provider->m_rtcNetworkThread)
+                provider->m_rtcNetworkThread->Stop();
+        });
     });
 }
 
     });
 }