summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-10-09 17:53:01 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-10-09 17:57:01 -0300
commit094a1ee9ac625e56d2792f37fe4feecc6a434501 (patch)
treeb822d364b3045d33bad228b7c5754fe092ce0d66
parente2c63f987e2f8a31fd5bb726c3a37371ada8d918 (diff)
downloadglade-3-8.tar.gz
Backport fix for glade_gtk_cell_renderer_sync_attributes()glade-3-8
Close issue #113 "Crash at glade_gtk_cell_renderer_sync_attributes()"
-rw-r--r--plugins/gtk+/glade-gtk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index c01a1d69..8244bd92 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -10638,6 +10638,7 @@ glade_gtk_cell_renderer_sync_attributes (GObject *object)
GtkCellLayout *layout;
GtkCellRenderer *cell;
GladeWidget *widget = glade_widget_get_from_gobject (object);
+ GladeWidget *parent;
GladeWidget *gmodel;
GladeProperty *property;
gchar *attr_prop_name;
@@ -10650,13 +10651,15 @@ glade_gtk_cell_renderer_sync_attributes (GObject *object)
/* Apply attributes to renderer when bound to a model in runtime */
widget = glade_widget_get_from_gobject (object);
-
- if (widget->parent == NULL) return FALSE;
+
+ parent = glade_widget_get_parent (widget);
+ if (parent == NULL)
+ return FALSE;
/* When creating widgets, sometimes the parent is set before parenting happens,
* here we have to be careful for that..
*/
- layout = GTK_CELL_LAYOUT (widget->parent->object);
+ layout = GTK_CELL_LAYOUT (parent->object);
cell = GTK_CELL_RENDERER (object);
if (!glade_gtk_cell_layout_has_renderer (layout, cell))