[epiphany] ephy-web-view: Fix potential crashers



commit 8d13ed7517ff5d9639c61c2b804c8ea59d815ed6
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Sep 11 00:24:13 2014 +0200

    ephy-web-view: Fix potential crashers
    
    The "form-auth-data-save-requested" signal was not properly disconnected
    as the g_signal_handlers_disconnect_by_func() was using the wrong
    object.
    
    The "allow-tls-certificate" signal was not disconnected at all.
    
    The "notify::favicon" was needlessly disconnected (it will be
    disconnected when the web view disappears).
    
    And the "cleared" signal for the history service was never disconnected.
    
    g_signal_connect_object() should ensure that all the signals we connect
    to that have the web view as data are disconnected when the web view is
    destroyed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735706

 embed/ephy-web-view.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 97e0efb..959eed4 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -732,13 +732,13 @@ page_created_cb (EphyEmbedShell *shell,
   priv->web_extension = web_extension;
   g_object_add_weak_pointer (G_OBJECT (priv->web_extension), (gpointer *)&priv->web_extension);
 
-  g_signal_connect (priv->web_extension, "form-auth-data-save-requested",
-                    G_CALLBACK (form_auth_data_save_requested),
-                    web_view);
+  g_signal_connect_object (priv->web_extension, "form-auth-data-save-requested",
+                           G_CALLBACK (form_auth_data_save_requested),
+                           web_view, 0);
 
-  g_signal_connect (priv->web_extension, "allow-tls-certificate",
-                    G_CALLBACK (allow_tls_certificate_cb),
-                    web_view);
+  g_signal_connect_object (priv->web_extension, "allow-tls-certificate",
+                           G_CALLBACK (allow_tls_certificate_cb),
+                           web_view, 0);
 }
 
 static void
@@ -750,10 +750,6 @@ ephy_web_view_dispose (GObject *object)
                                         ephy_web_view_history_cleared_cb,
                                         EPHY_WEB_VIEW (object));
 
-  g_signal_handlers_disconnect_by_func (object, icon_changed_cb, NULL);
-
-  g_signal_handlers_disconnect_by_func (ephy_embed_shell_get_default (), form_auth_data_save_requested, 
object);
-
   g_clear_object (&priv->file_monitor);
 
   g_clear_object (&priv->icon);
@@ -2108,9 +2104,9 @@ ephy_web_view_init (EphyWebView *web_view)
   priv->history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ()));
   priv->history_service_cancellable = g_cancellable_new ();
 
-  g_signal_connect (priv->history_service,
-                    "cleared", G_CALLBACK (ephy_web_view_history_cleared_cb),
-                    web_view);
+  g_signal_connect_object (priv->history_service,
+                           "cleared", G_CALLBACK (ephy_web_view_history_cleared_cb),
+                           web_view, 0);
 
   g_signal_connect (web_view, "decide-policy",
                     G_CALLBACK (decide_policy_cb),


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