Title: [187586] trunk/Source/WebCore
Revision
187586
Author
mcatanz...@igalia.com
Date
2015-07-30 09:21:45 -0700 (Thu, 30 Jul 2015)

Log Message

[GTK] Crashes when SoupSession is destroyed in exit handler
https://bugs.webkit.org/show_bug.cgi?id=145347

Reviewed by Carlos Garcia Campos.

Leak the default SoupSession with NeverDestroyed to avoid races at program exit.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::defaultSession):
* platform/network/soup/SoupNetworkSession.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (187585 => 187586)


--- trunk/Source/WebCore/ChangeLog	2015-07-30 16:16:23 UTC (rev 187585)
+++ trunk/Source/WebCore/ChangeLog	2015-07-30 16:21:45 UTC (rev 187586)
@@ -1,3 +1,16 @@
+2015-07-30  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        [GTK] Crashes when SoupSession is destroyed in exit handler
+        https://bugs.webkit.org/show_bug.cgi?id=145347
+
+        Reviewed by Carlos Garcia Campos.
+
+        Leak the default SoupSession with NeverDestroyed to avoid races at program exit.
+
+        * platform/network/soup/SoupNetworkSession.cpp:
+        (WebCore::SoupNetworkSession::defaultSession):
+        * platform/network/soup/SoupNetworkSession.h:
+
 2015-07-30  Alex Christensen  <achristen...@webkit.org>
 
         Build AppleWin port with CMake

Modified: trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp (187585 => 187586)


--- trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp	2015-07-30 16:16:23 UTC (rev 187585)
+++ trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp	2015-07-30 16:21:45 UTC (rev 187586)
@@ -37,6 +37,7 @@
 #include "ResourceHandle.h"
 #include <glib/gstdio.h>
 #include <libsoup/soup.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 
@@ -51,7 +52,7 @@
 
 SoupNetworkSession& SoupNetworkSession::defaultSession()
 {
-    static SoupNetworkSession networkSession(soupCookieJar());
+    static NeverDestroyed<SoupNetworkSession> networkSession(soupCookieJar());
     return networkSession;
 }
 

Modified: trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h (187585 => 187586)


--- trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h	2015-07-30 16:16:23 UTC (rev 187585)
+++ trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h	2015-07-30 16:21:45 UTC (rev 187586)
@@ -70,6 +70,8 @@
     void setAcceptLanguages(const Vector<String>&);
 
 private:
+    friend class NeverDestroyed<SoupNetworkSession>;
+
     SoupNetworkSession(SoupCookieJar*);
     SoupNetworkSession(SoupSession*);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to