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 20:59:11 -0300 |
commit | bb43c9a2a32c1ade500cdf40856139a086b9f22b (patch) | |
tree | afe1be6e5f0255ddefa1284969071cbbfc7124e8 | |
parent | 9f1b36c9bd61dab87af34b3793408c3047ce5e33 (diff) | |
download | glade-bb43c9a2a32c1ade500cdf40856139a086b9f22b.tar.gz |
Gtk+ plugin: fix GtkStack replace child function
Fi bug 793652 "Crash when deleting a list"
-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); } |