r15476 - gnucash/trunk/src - Fix bug in dispose for gnc-sx-list-tree-model-adapter causing (eventual) crash when sx-list plugin page is closed.
Josh Sled
jsled at cvs.gnucash.org
Tue Jan 30 21:25:33 EST 2007
Author: jsled
Date: 2007-01-30 21:25:32 -0500 (Tue, 30 Jan 2007)
New Revision: 15476
Trac: http://svn.gnucash.org/trac/changeset/15476
Modified:
gnucash/trunk/src/doc/sx.rst
gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c
gnucash/trunk/src/gnome/gnc-sx-list-tree-model-adapter.c
Log:
Fix bug in dispose for gnc-sx-list-tree-model-adapter causing (eventual) crash when sx-list plugin page is closed.
Modified: gnucash/trunk/src/doc/sx.rst
===================================================================
--- gnucash/trunk/src/doc/sx.rst 2007-01-31 02:05:02 UTC (rev 15475)
+++ gnucash/trunk/src/doc/sx.rst 2007-01-31 02:25:32 UTC (rev 15476)
@@ -60,7 +60,7 @@
- bugs
- [ ] with SLR open (with instances), add variables to SX; only newly-created instances will have appropriate variable tables.
-! - [ ] crash with two sx lists open and SX mutation
+! - [x] crash with two sx lists open and SX mutation
- I'm pretty sure this is due to SX lists not getting cleaned up on page close, somehow.
[[[
(gnucash:17610): GLib-GObject-WARNING **: invalid unclassed pointer in cast to `GncSxListTreeModelAdapterType'
Modified: gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c 2007-01-31 02:05:02 UTC (rev 15475)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c 2007-01-31 02:25:32 UTC (rev 15476)
@@ -233,10 +233,10 @@
priv->dense_cal_model = NULL;
gtk_widget_unref(GTK_WIDGET(priv->gdcal));
priv->gdcal = NULL;
+ g_object_unref(G_OBJECT(priv->tree_model));
+ priv->tree_model = NULL;
g_object_unref(G_OBJECT(priv->instances));
priv->instances = NULL;
- g_object_unref(G_OBJECT(priv->tree_model));
- priv->tree_model = NULL;
G_OBJECT_CLASS (parent_class)->dispose(object);
LEAVE(" ");
@@ -390,8 +390,9 @@
priv->dense_cal_model = gnc_sx_instance_dense_cal_adapter_new(GNC_SX_INSTANCE_MODEL(priv->instances));
priv->gdcal = GNC_DENSE_CAL(gnc_dense_cal_new_with_model(GNC_DENSE_CAL_MODEL(priv->dense_cal_model)));
// gobject-2.10: g_object_ref_sink(G_OBJECT(priv->gdcal));
- g_object_ref(G_OBJECT(priv->gdcal));
- gtk_object_sink(GTK_OBJECT(priv->gdcal));
+ g_object_ref(G_OBJECT(priv->gdcal));
+ gtk_object_sink(GTK_OBJECT(priv->gdcal));
+
gnc_dense_cal_set_months_per_col(priv->gdcal, 4);
gnc_dense_cal_set_num_months(priv->gdcal, 12);
@@ -449,7 +450,7 @@
{
GncPluginPageSxList *page;
GncPluginPageSxListPrivate *priv;
-
+
g_return_if_fail(GNC_IS_PLUGIN_PAGE_SX_LIST(plugin_page));
g_return_if_fail(key_file != NULL);
g_return_if_fail(group_name != NULL);
@@ -482,7 +483,7 @@
{
GncPluginPageSxList *page;
GncPluginPageSxListPrivate *priv;
-
+
g_return_val_if_fail(key_file, NULL);
g_return_val_if_fail(group_name, NULL);
ENTER("key_file %p, group_name %s", key_file, group_name);
Modified: gnucash/trunk/src/gnome/gnc-sx-list-tree-model-adapter.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-sx-list-tree-model-adapter.c 2007-01-31 02:05:02 UTC (rev 15475)
+++ gnucash/trunk/src/gnome/gnc-sx-list-tree-model-adapter.c 2007-01-31 02:25:32 UTC (rev 15476)
@@ -579,7 +579,8 @@
g_return_if_fail(obj != NULL);
adapter = GNC_SX_LIST_TREE_MODEL_ADAPTER(obj);
- g_return_if_fail(adapter->disposed);
+
+ if (adapter->disposed) return;
adapter->disposed = TRUE;
g_object_unref(G_OBJECT(adapter->instances));
More information about the gnucash-changes
mailing list