Unref the summary bar list store so that it gets deleted together with the combobox.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13597 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2006-03-11 15:52:45 +00:00
parent b39a0305fc
commit 2a3b4aa51f
2 changed files with 16 additions and 9 deletions

View File

@ -1,5 +1,8 @@
2006-03-11 Andreas Köhler <andi5.py@gmx.net>
* src/gnome-utils/window-main-summarybar.c: Unref the summary bar
list store so that it gets deleted together with the combobox.
* src/gnome-utils/gnc-tree-view-account.c: Avoid calculation of
account period total for the top level account.

View File

@ -397,6 +397,7 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)
lc = gnc_localeconv();
g_object_ref(summary->datamodel);
gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo), NULL);
gtk_list_store_clear(summary->datamodel);
for (current = g_list_first(currency_list); current; current = g_list_next(current)) {
@ -433,15 +434,15 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)
}
gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo),
GTK_TREE_MODEL(summary->datamodel));
g_object_unref(summary->datamodel);
gtk_combo_box_set_active(GTK_COMBO_BOX(summary->totals_combo), 0);
}
}
static void
gnc_main_window_summary_destroy_cb(GtkObject * obj, gpointer data)
gnc_main_window_summary_destroy_cb(GNCMainSummary *summary, gpointer data)
{
GNCMainSummary * summary = data;
gnc_gconf_remove_anon_notification(GCONF_SECTION, summary->cnxn_id);
gnc_unregister_gui_component(summary->component_id);
g_free(summary);
@ -484,6 +485,8 @@ gnc_main_window_summary_new (void)
retval->hbox = gtk_hbox_new (FALSE, 5);
retval->totals_combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (retval->datamodel));
g_object_unref (retval->datamodel);
retval->component_id = gnc_register_gui_component (WINDOW_SUMMARYBAR_CM_CLASS,
summarybar_refresh_handler,
NULL, retval);
@ -503,8 +506,9 @@ gnc_main_window_summary_new (void)
gtk_widget_show (retval->totals_combo);
gtk_widget_show (retval->hbox);
g_signal_connect(G_OBJECT(retval->hbox), "destroy",
G_CALLBACK(gnc_main_window_summary_destroy_cb), retval);
g_signal_connect_swapped (G_OBJECT (retval->hbox), "destroy",
G_CALLBACK (gnc_main_window_summary_destroy_cb),
retval);
gnc_main_window_summary_refresh(retval);