[gedit] notebook-stack-switcher: fix assertion at exit
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] notebook-stack-switcher: fix assertion at exit
- Date: Wed, 25 Mar 2015 08:45:56 +0000 (UTC)
commit f982a19e72e8b615cd19b0758e5173df38ff32e6
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Mar 25 09:45:07 2015 +0100
notebook-stack-switcher: fix assertion at exit
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=746691
gedit/gedit-notebook-stack-switcher.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-notebook-stack-switcher.c b/gedit/gedit-notebook-stack-switcher.c
index 0575ed1..ca2b56c 100644
--- a/gedit/gedit-notebook-stack-switcher.c
+++ b/gedit/gedit-notebook-stack-switcher.c
@@ -206,7 +206,14 @@ on_notebook_switch_page (GtkNotebook *notebook,
GtkWidget *child;
child = g_object_get_data (G_OBJECT (page), "stack-child");
- if (child != NULL)
+
+ /* NOTE: we make the assumption here that if there is no visible child
+ * it means that the child does not contain any child already, this is
+ * to avoid an assertion when closing gedit, since the remove signal
+ * runs first on the stack handler so we try to set a visible child
+ * when the stack already does not handle that child
+ */
+ if (child != NULL && gtk_stack_get_visible_child (priv->stack) != NULL)
{
gtk_stack_set_visible_child (priv->stack, child);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]