Fix bug in dispose for gnc-sx-list-tree-model-adapter causing (eventual) crash when sx-list plugin page is closed.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15476 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled 2007-01-31 02:25:32 +00:00
parent f042147ca5
commit 227489040d
3 changed files with 10 additions and 8 deletions

View File

@ -60,7 +60,7 @@ TODO
- 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'

View File

@ -233,10 +233,10 @@ gnc_plugin_page_sx_list_dispose(GObject *object)
priv->dense_cal_model = NULL;
gtk_widget_unref(GTK_WIDGET(priv->gdcal));
priv->gdcal = 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_unref(G_OBJECT(priv->instances));
priv->instances = NULL;
G_OBJECT_CLASS (parent_class)->dispose(object);
LEAVE(" ");
@ -390,8 +390,9 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
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 @@ gnc_plugin_page_sx_list_save_page (GncPluginPage *plugin_page,
{
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 @@ gnc_plugin_page_sx_list_recreate_page (GtkWidget *window,
{
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);

View File

@ -579,7 +579,8 @@ gnc_sx_list_tree_model_adapter_dispose(GObject *obj)
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));