Reviewed by Xan Lopez.
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Nov 2009 13:01:00 +0000 (13:01 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Nov 2009 13:01:00 +0000 (13:01 +0000)
        Some tests are crashing from time to time
        https://bugs.webkit.org/show_bug.cgi?id=31866

        Make sure we do not notify the client of a finished load, if the
        load has been cancelled, or the client is gone.

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

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

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

index 13363ba2930de3d73f42f8e1a39b1b4b06fca64c..96120c59eef5174656bba8400ef9f66d2b805f0f 100644 (file)
@@ -1,3 +1,16 @@
+2009-11-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        Some tests are crashing from time to time
+        https://bugs.webkit.org/show_bug.cgi?id=31866
+
+        Make sure we do not notify the client of a finished load, if the
+        load has been cancelled, or the client is gone.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::):
+
 2009-11-24  Ben Murdoch  <benm@google.com>
 
         Reviewed by Eric Seidel.
index 2e497ab006e9ff45788388c249755149486e8ef0..6367a3e3ae67c3aa02f709556b8e9c89eef5fb28 100644 (file)
@@ -693,6 +693,13 @@ static void closeCallback(GObject* source, GAsyncResult* res, gpointer)
 
     g_input_stream_close_finish(d->m_inputStream, res, 0);
     cleanupGioOperation(handle.get());
+
+    // The load may have been cancelled, the client may have been
+    // destroyed already. In such cases calling didFinishLoading is a
+    // bad idea.
+    if (d->m_cancelled || !client)
+        return;
+
     client->didFinishLoading(handle.get());
 }