diff options
author | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2018-02-28 20:58:03 -0300 |
---|---|---|
committer | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2018-02-28 21:18:05 -0300 |
commit | ebd3634c85465ee27f345cd904704ce5379d6d4a (patch) | |
tree | 5d8c553aa7ab88b63680a335f2295ec812c5d776 /plugins | |
parent | b9763bfada7c9ecc2532563a97c387f8c20962b5 (diff) | |
download | glade-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.c | 11 |
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); } |