[epiphany/mcatanzaro/download-critical] download: prepare for WebKitDownload to outlive the EphyDownload



commit f793d533d4d9dc6eda6c5d20648721cd61859523
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri May 24 15:51:02 2019 -0500

    download: prepare for WebKitDownload to outlive the EphyDownload
    
    I'm seeing occasional criticals when a WebKitDownload outlives the
    EphyDownload, so better protect here.

 embed/ephy-download.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index 92ec830de..9ee900aab 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -883,21 +883,21 @@ ephy_download_new_internal (WebKitDownload *download)
 
   ephy_download = g_object_new (EPHY_TYPE_DOWNLOAD, NULL);
 
-  g_signal_connect (download, "notify::response",
-                    G_CALLBACK (download_response_changed_cb),
-                    ephy_download);
-  g_signal_connect (download, "decide-destination",
-                    G_CALLBACK (download_decide_destination_cb),
-                    ephy_download);
-  g_signal_connect (download, "created-destination",
-                    G_CALLBACK (download_created_destination_cb),
-                    ephy_download);
-  g_signal_connect (download, "finished",
-                    G_CALLBACK (download_finished_cb),
-                    ephy_download);
-  g_signal_connect (download, "failed",
-                    G_CALLBACK (download_failed_cb),
-                    ephy_download);
+  g_signal_connect_object (download, "notify::response",
+                           G_CALLBACK (download_response_changed_cb),
+                           ephy_download, 0);
+  g_signal_connect_object (download, "decide-destination",
+                           G_CALLBACK (download_decide_destination_cb),
+                           ephy_download, 0);
+  g_signal_connect_object (download, "created-destination",
+                           G_CALLBACK (download_created_destination_cb),
+                           ephy_download, 0);
+  g_signal_connect_object (download, "finished",
+                           G_CALLBACK (download_finished_cb),
+                           ephy_download, 0);
+  g_signal_connect_object (download, "failed",
+                           G_CALLBACK (download_failed_cb),
+                           ephy_download, 0);
 
   ephy_download->download = g_object_ref (download);
   g_object_set_data (G_OBJECT (download), "ephy-download-set", GINT_TO_POINTER (TRUE));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]