[GTK][WPE] Race condition when destroying webprocesses
authormagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2018 16:26:42 +0000 (16:26 +0000)
committermagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2018 16:26:42 +0000 (16:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184445

Reviewed by Carlos Garcia Campos.

Ensure that the WebProcess is properly closing its pages when it's exiting because
the UIProcess has invalidated the IPC connection.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didClose):

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

Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebProcess.cpp

index 1bb810c..7b5fbbf 100644 (file)
@@ -1,3 +1,16 @@
+2018-04-10  Miguel Gomez  <magomez@igalia.com>
+
+        [GTK][WPE] Race condition when destroying webprocesses
+        https://bugs.webkit.org/show_bug.cgi?id=184445
+
+        Reviewed by Carlos Garcia Campos.
+
+        Ensure that the WebProcess is properly closing its pages when it's exiting because
+        the UIProcess has invalidated the IPC connection.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didClose):
+
 2018-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Add missing availability macros after r230462
index 4ccc5e1..87ab736 100644 (file)
@@ -686,10 +686,12 @@ void WebProcess::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& de
 
 void WebProcess::didClose(IPC::Connection&)
 {
-#ifndef NDEBUG
+#if !defined(NDEBUG) || PLATFORM(GTK) || PLATFORM(WPE)
     for (auto& page : copyToVector(m_pageMap.values()))
         page->close();
+#endif
 
+#ifndef NDEBUG
     GCController::singleton().garbageCollectSoon();
     FontCache::singleton().invalidate();
     MemoryCache::singleton().setDisabled(true);