[glade] Bug 754131: Avoid crashes when loading boxes with center-child children



commit 0ed81f09e51aefa36eb80bb7cad9722fa85b8bf0
Author: Tristan Van Berkom <tristan upstairslabs com>
Date:   Wed Dec 9 13:16:20 2015 +0900

    Bug 754131: Avoid crashes when loading boxes with center-child children
    
    Patch by Juan Pablo Ugarte

 plugins/gtk+/glade-gtk-box.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-box.c b/plugins/gtk+/glade-gtk-box.c
index 8b9d228..6a0eb0a 100644
--- a/plugins/gtk+/glade-gtk-box.c
+++ b/plugins/gtk+/glade-gtk-box.c
@@ -57,12 +57,12 @@ glade_gtk_box_create_editable (GladeWidgetAdaptor * adaptor,
 }
 
 static void
-glade_gtk_box_parse_finished (GladeProject * project, GObject * object)
+glade_gtk_box_parse_finished (GladeProject * project, GObject *gbox)
 {
-  GladeWidget *gbox;
+  GObject *box = glade_widget_get_object (gbox);
 
-  gbox = glade_widget_get_from_gobject (object);
-  glade_widget_property_set (gbox, "use-center-child", gtk_box_get_center_widget (GTK_BOX (object)) != NULL);
+  glade_widget_property_set (gbox, "use-center-child",
+                             gtk_box_get_center_widget (GTK_BOX (box)) != NULL);
 }
 
 void
@@ -87,9 +87,9 @@ glade_gtk_box_post_create (GladeWidgetAdaptor * adaptor,
 
   if (reason == GLADE_CREATE_LOAD)
     {
-      g_signal_connect (project, "parse-finished",
-                        G_CALLBACK (glade_gtk_box_parse_finished),
-                        container);
+      g_signal_connect_object (project, "parse-finished",
+                               G_CALLBACK (glade_gtk_box_parse_finished),
+                               gwidget, 0);
     }
 }
 


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