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 --- calendar/ChangeLog | 7 +++++++ calendar/gui/comp-editor-factory.c | 30 ++++++++++-------------------- 2 files changed, 17 insertions(+), 20 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 44954fc8e0..df79689212 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2007-10-02 Matthew Barnes + + ** Fixes part of bug #469657 + + * gui/comp-editor-factory.c: + Use destroy functions in GHashTables to simplify memory management. + 2007-10-01 Milan Crha ** Fix for bug #428402 diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index 95216604c8..dd508987d4 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -129,18 +129,6 @@ comp_editor_factory_class_init (CompEditorFactoryClass *class) object_class->finalize = comp_editor_factory_finalize; } -/* Object initialization function for the component editor factory */ -static void -comp_editor_factory_init (CompEditorFactory *factory) -{ - CompEditorFactoryPrivate *priv; - - priv = g_new (CompEditorFactoryPrivate, 1); - factory->priv = priv; - - priv->uri_client_hash = g_hash_table_new (g_str_hash, g_str_equal); -} - /* Frees a Request structure */ static void free_request (Request *r) @@ -175,14 +163,19 @@ free_client (OpenClient *oc) g_free (oc); } -/* Used from g_hash_table_foreach(); frees a client structure */ +/* Object initialization function for the component editor factory */ static void -free_client_cb (gpointer key, gpointer value, gpointer data) +comp_editor_factory_init (CompEditorFactory *factory) { - OpenClient *oc; + CompEditorFactoryPrivate *priv; + + priv = g_new (CompEditorFactoryPrivate, 1); + factory->priv = priv; - oc = value; - free_client (oc); + priv->uri_client_hash = g_hash_table_new_full ( + g_str_hash, g_str_equal, + (GDestroyNotify) NULL, + (GDestroyNotify) free_client); } /* Destroy handler for the component editor factory */ @@ -198,7 +191,6 @@ comp_editor_factory_finalize (GObject *object) factory = COMP_EDITOR_FACTORY (object); priv = factory->priv; - g_hash_table_foreach (priv->uri_client_hash, free_client_cb, NULL); g_hash_table_destroy (priv->uri_client_hash); priv->uri_client_hash = NULL; @@ -232,7 +224,6 @@ editor_destroy_cb (GtkObject *object, gpointer data) return; g_hash_table_remove (priv->uri_client_hash, oc->uri); - free_client (oc); } /* Starts editing an existing component on a client that is already open */ @@ -442,7 +433,6 @@ cal_opened_cb (ECal *client, ECalendarStatus status, gpointer data) gtk_widget_destroy (dialog); g_hash_table_remove (priv->uri_client_hash, oc->uri); - free_client (oc); } /* Creates a new OpenClient structure and queues the component editing/creation -- cgit v1.2.3