[epiphany] ephy-web-view: Clean up after outliving web extension proxies



commit 3596b8e88b0b98a5133c609124458d6d0d968062
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jul 2 15:56:44 2015 +0200

    ephy-web-view: Clean up after outliving web extension proxies
    
    If the EphyWebView is destroyed before the EphyWebExtensionProxy
    it's attached to does, we'll leave a dangling weak pointer, which
    will nullify random memory at the time the web extension proxy
    is actually destroyed.
    
    So, prepare for undoing the effects of page_created_cb() in case
    we ::dispose() when we still have a web extension attached.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747422

 embed/ephy-web-view.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 95666fc..1b58953 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -748,6 +748,12 @@ ephy_web_view_dispose (GObject *object)
 {
   EphyWebViewPrivate *priv = EPHY_WEB_VIEW (object)->priv;
 
+  if (priv->web_extension)
+    {
+      g_object_remove_weak_pointer (G_OBJECT (priv->web_extension), (gpointer *)&priv->web_extension);
+      priv->web_extension = NULL;
+    }
+
   g_signal_handlers_disconnect_by_func (priv->history_service,
                                         ephy_web_view_history_cleared_cb,
                                         EPHY_WEB_VIEW (object));


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