summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2018-02-28 20:58:03 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2018-02-28 21:18:05 -0300
commitebd3634c85465ee27f345cd904704ce5379d6d4a (patch)
tree5d8c553aa7ab88b63680a335f2295ec812c5d776 /plugins
parentb9763bfada7c9ecc2532563a97c387f8c20962b5 (diff)
downloadglade-ebd3634c85465ee27f345cd904704ce5379d6d4a.tar.gz
Gtk+ plugin: fix GtkStack replace child function
Fi bug 793652 "Crash when deleting a list"
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtk+/glade-gtk-stack.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/gtk+/glade-gtk-stack.c b/plugins/gtk+/glade-gtk-stack.c
index 3cf3c3a0..28bb6796 100644
--- a/plugins/gtk+/glade-gtk-stack.c
+++ b/plugins/gtk+/glade-gtk-stack.c
@@ -548,13 +548,16 @@ glade_gtk_stack_replace_child (GladeWidgetAdaptor * adaptor,
new_widget);
gbox = glade_widget_get_from_gobject (container);
- glade_widget_property_get (gbox, "pages", &pages);
- glade_widget_property_set (gbox, "pages", pages);
- glade_widget_property_get (gbox, "page", &page);
- glade_widget_property_set (gbox, "page", page);
gchild = glade_widget_get_from_gobject (new_widget);
if (gchild != NULL)
glade_widget_set_pack_action_visible (gchild, "remove_page", FALSE);
+ /* NOTE: make sure to sync this at the end because new_widget could be
+ * a placeholder and syncing these properties could destroy it.
+ */
+ glade_widget_property_get (gbox, "pages", &pages);
+ glade_widget_property_set (gbox, "pages", pages);
+ glade_widget_property_get (gbox, "page", &page);
+ glade_widget_property_set (gbox, "page", page);
}