[epiphany/gnome-3-30] download: prepare for WebKitDownload to outlive the EphyDownload



commit 4d906916dfd2185ba74dd4262fa5c024e525ce85
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri May 24 20:51:02 2019 +0000

    download: prepare for WebKitDownload to outlive the EphyDownload
    
    I'm seeing occasional criticals when a WebKitDownload outlives the
    EphyDownload, so better protect here.
    
    
    (cherry picked from commit f793d533d4d9dc6eda6c5d20648721cd61859523)

 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 e10dabf05..251af06a7 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -759,21 +759,21 @@ ephy_download_new (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]