[gnumeric] GUI: Fix potential crash on exit.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: Fix potential crash on exit.
- Date: Mon, 21 Feb 2011 17:00:27 +0000 (UTC)
commit 438d0e5061082ded281f0e6fe3a8f9dc039314f4
Author: Morten Welinder <terra gnome org>
Date: Mon Feb 21 12:00:05 2011 -0500
GUI: Fix potential crash on exit.
ChangeLog | 2 ++
src/wbc-gtk.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 42c02a3..c8471b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
* src/wbc-gtk.c (wbc_gtk_finalize): Cancel template loader handler
if necessary.
+ (wbc_gtk_create_notebook_area): Hold a ref to bnotebook so it
+ cannot disappear underneath us.
2011-02-17 Morten Welinder <terra gnome org>
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 24586f2..881bd90 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -1090,6 +1090,8 @@ wbc_gtk_create_notebook_area (WBCGtk *wbcg)
"tab-hborder", 0,
"tab-vborder", 0,
NULL);
+ g_object_ref (wbcg->bnotebook);
+
g_signal_connect_after (G_OBJECT (wbcg->bnotebook),
"switch_page",
G_CALLBACK (cb_notebook_switch_page), wbcg);
@@ -5279,6 +5281,7 @@ wbc_gtk_finalize (GObject *obj)
}
g_hash_table_destroy (wbcg->custom_uis);
+ wbcg->custom_uis = NULL;
UNREF_OBJ (zoom_vaction);
UNREF_OBJ (zoom_haction);
@@ -5308,6 +5311,8 @@ wbc_gtk_finalize (GObject *obj)
g_signal_handlers_disconnect_by_func (
G_OBJECT (wbcg->bnotebook),
G_CALLBACK (cb_notebook_switch_page), wbcg);
+ UNREF_OBJ (bnotebook);
+
g_signal_handlers_disconnect_by_func (
G_OBJECT (wbcg->toplevel),
G_CALLBACK (cb_set_focus), wbcg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]