2008-06-17 Marco Barisione <marco.barisione@collabora.co.uk>
authorjmalonzo@webkit.org <jmalonzo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Aug 2008 05:01:00 +0000 (05:01 +0000)
committerjmalonzo@webkit.org <jmalonzo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Aug 2008 05:01:00 +0000 (05:01 +0000)
        Reviewed by Eric Seidel.

        https://bugs.webkit.org/show_bug.cgi?id=19603
        [SOUP] segfault when closing a file using gio

        Call client->didFinishLoading() only after releasing all the gio
        resources.

        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::closeCallback):
        (WebCore::readCallback):

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

WebCore/ChangeLog
WebCore/platform/network/soup/ResourceHandleSoup.cpp

index 8d5ce87..b7a404a 100644 (file)
@@ -1,3 +1,17 @@
+2008-06-17  Marco Barisione  <marco.barisione@collabora.co.uk>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=19603
+        [SOUP] segfault when closing a file using gio
+
+        Call client->didFinishLoading() only after releasing all the gio
+        resources.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::closeCallback):
+        (WebCore::readCallback):
+
 2008-08-01  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Jon.
index 69e0829..025e0c9 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2008 Alp Toker <alp@atoker.com>
  * Copyright (C) 2008 Xan Lopez <xan@gnome.org>
+ * Copyright (C) 2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -412,9 +413,11 @@ static void closeCallback(GObject* source, GAsyncResult* res, gpointer data)
 {
     ResourceHandle* handle = static_cast<ResourceHandle*>(data);
     ResourceHandleInternal* d = handle->getInternal();
+    ResourceHandleClient* client = handle->client();
 
     g_input_stream_close_finish(d->m_input_stream, res, NULL);
     cleanupGioOperation(handle);
+    client->didFinishLoading(handle);
 }
 
 static void readCallback(GObject* source, GAsyncResult* res, gpointer data)
@@ -438,7 +441,6 @@ static void readCallback(GObject* source, GAsyncResult* res, gpointer data)
         client->didFinishLoading(handle);
         return;
     } else if (!nread) {
-        client->didFinishLoading(handle);
         g_input_stream_close_async(d->m_input_stream, G_PRIORITY_DEFAULT,
                                    NULL, closeCallback, handle);
         return;