[gtk+] GtkTextHandle: Deal with parent_scrollable going away



commit 479babf339ad25296089ef1aed6d9823d1a86625
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 17 22:27:35 2014 -0500

    GtkTextHandle: Deal with parent_scrollable going away
    
    Use a weak reference to notice when parent_scrollable is
    going away.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724392

 gtk/gtktexthandle.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index 0f05d5a..0634749 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -371,12 +371,16 @@ _gtk_text_handle_set_scrollable (GtkTextHandle *handle,
           g_object_unref (priv->hadj);
           priv->hadj = NULL;
         }
+ 
+      g_object_remove_weak_pointer (G_OBJECT (priv->parent_scrollable), (gpointer *) 
&priv->parent_scrollable);
     }
 
   priv->parent_scrollable = scrollable;
 
   if (scrollable)
     {
+      g_object_add_weak_pointer (G_OBJECT (priv->parent_scrollable), (gpointer *) &priv->parent_scrollable);
+
       priv->vadj = gtk_scrollable_get_vadjustment (scrollable);
       priv->hadj = gtk_scrollable_get_hadjustment (scrollable);
 


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