From 09d4af6fff63dd112b8bb42087f14f7018e2f78c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 2 Oct 2007 11:54:42 +0000 Subject: ** Fixes bug #469657 2007-10-02 Matthew Barnes ** Fixes bug #469657 * addressbook/importers/evolution-ldif-importer.c: * calendar/gui/comp-editor-factory.c: * composer/e-msg-composer.c: * e-util/e-config-listener.c: * mail/em-composer-prefs.c: * mail/em-folder-tree-model.c: * mail/em-format.c: * mail/em-format-html.c: * mail/em-migrate.c: * mail/em-subscribe-editor.c: * mail/mail-component.c: * mail/mail-send-recv.c: * mail/message-list.c: * mail/importers/elm-importer.c: * plugins/exchange-operations/exchange-folder-size-display.c: * plugins/mono/mono-plugin.c: * shell/e-shell-settings-dialog.c: * tools/killev.c: * widgets/table/e-table-extras.c: * widgets/table/e-table-selection-model.c: Use destroy functions in GHashTables to simplify memory management. svn path=/trunk/; revision=34344 --- mail/em-composer-prefs.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'mail/em-composer-prefs.c') diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c index 7805c8a61b..15944bad72 100644 --- a/mail/em-composer-prefs.c +++ b/mail/em-composer-prefs.c @@ -121,13 +121,10 @@ static void em_composer_prefs_init (EMComposerPrefs *prefs) { prefs->enabled_pixbuf = e_icon_factory_get_icon ("stock_mark", E_ICON_SIZE_MENU); - prefs->sig_hash = g_hash_table_new (g_direct_hash, g_direct_equal); -} - -static void -row_free (ESignature *sig, GtkTreeRowReference *row, gpointer user_data) -{ - gtk_tree_row_reference_free (row); + prefs->sig_hash = g_hash_table_new_full ( + g_direct_hash, g_direct_equal, + (GDestroyNotify) NULL, + (GDestroyNotify) gtk_tree_row_reference_free); } static void @@ -138,7 +135,6 @@ em_composer_prefs_finalise (GObject *obj) g_object_unref (prefs->gui); g_object_unref (prefs->enabled_pixbuf); - g_hash_table_foreach (prefs->sig_hash, (GHFunc) row_free, NULL); g_hash_table_destroy (prefs->sig_hash); G_OBJECT_CLASS (parent_class)->finalize (obj); @@ -241,11 +237,9 @@ signature_removed (ESignatureList *signatures, ESignature *sig, EMComposerPrefs if (!(row = g_hash_table_lookup (prefs->sig_hash, sig))) return; - g_hash_table_remove (prefs->sig_hash, sig); - model = gtk_tree_view_get_model (prefs->sig_list); path = gtk_tree_row_reference_get_path (row); - gtk_tree_row_reference_free (row); + g_hash_table_remove (prefs->sig_hash, sig); if (!gtk_tree_model_get_iter (model, &iter, path)) { gtk_tree_path_free (path); -- cgit v1.2.3