[Soup] The NeverDestroyed<std::unique_ptr<NetworkStorageSession>> variable in default...
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Oct 2013 21:14:58 +0000 (21:14 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Oct 2013 21:14:58 +0000 (21:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122700

Reviewed by Anders Carlsson.

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::defaultSession): The NeverDestroyed variable should be static to avoid its reinitialization every time
the function is called. This was exposed by r157337 and should fix the subsequent crashes.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp

index 2783579..264c5fe 100644 (file)
@@ -1,3 +1,14 @@
+2013-10-12  Zan Dobersek  <zdobersek@igalia.com>
+
+        [Soup] The NeverDestroyed<std::unique_ptr<NetworkStorageSession>> variable in defaultSession() should be static
+        https://bugs.webkit.org/show_bug.cgi?id=122700
+
+        Reviewed by Anders Carlsson.
+
+        * platform/network/soup/NetworkStorageSessionSoup.cpp:
+        (WebCore::defaultSession): The NeverDestroyed variable should be static to avoid its reinitialization every time
+        the function is called. This was exposed by r157337 and should fix the subsequent crashes.
+
 2013-10-12  Antti Koivisto  <antti@apple.com>
 
         Move line dirtying code to RenderTextLineBoxes
index 8b77525..74d108a 100644 (file)
@@ -42,7 +42,7 @@ NetworkStorageSession::NetworkStorageSession(SoupSession* session)
 static std::unique_ptr<NetworkStorageSession>& defaultSession()
 {
     ASSERT(isMainThread());
-    NeverDestroyed<std::unique_ptr<NetworkStorageSession>> session;
+    static NeverDestroyed<std::unique_ptr<NetworkStorageSession>> session;
     return session;
 }