[epiphany/gnome-3-12] ephy-web-view: Fix potential crashers



commit 360480136e9f4eb90bfd907cd342535cea5a1087
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
    
    Conflicts:
        embed/ephy-web-view.c

 embed/ephy-web-view.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index de2e36f..e90891d 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -709,9 +709,9 @@ 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);
 }
 
 static void
@@ -723,10 +723,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);
@@ -1922,9 +1918,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]