[epiphany/gnome-3-16] Be more careful with weak pointers



commit b17a94c66362001f62bd0e09fab51bffa62d45b3
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Thu Jul 2 14:04:27 2015 -0500

    Be more careful with weak pointers
    
    As a follow-up to bug #747422, be careful to remove weak pointers to
    objects when it appears that the lifetime of the object can outlive the
    lifetime of the memory location of the pointer.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751858

 embed/ephy-web-view.c                    |    6 ++++++
 embed/web-extension/ephy-web-extension.c |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 1b58953..aa3f3c9 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -754,6 +754,12 @@ ephy_web_view_dispose (GObject *object)
       priv->web_extension = NULL;
     }
 
+  if (priv->password_info_bar)
+    {
+      g_object_remove_weak_pointer (G_OBJECT (priv->password_info_bar), (gpointer 
*)&priv->password_info_bar);
+      priv->password_info_bar = NULL;
+    }
+
   g_signal_handlers_disconnect_by_func (priv->history_service,
                                         ephy_web_view_history_cleared_cb,
                                         EPHY_WEB_VIEW (object));
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index 17fd4f3..26323bd 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -1260,6 +1260,8 @@ ephy_web_extension_dispose (GObject *object)
     }
 
   if (extension->priv->dbus_connection) {
+    g_object_remove_weak_pointer (G_OBJECT (extension->priv->dbus_connection),
+                                  (gpointer *)&extension->priv->dbus_connection);
     g_dbus_connection_unregister_object (extension->priv->dbus_connection,
                                          extension->priv->registration_id);
     extension->priv->registration_id = 0;


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