From 7aaf603811ea4853f71edfbc407ed074588e6d5f Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 25 Sep 2002 18:50:34 +0000 Subject: free adapter->priv. 2002-09-23 Chris Toshok * gui/widgets/e-addressbook-table-adapter.c (addressbook_destroy): free adapter->priv. * gui/widgets/e-addressbook-model.c (addressbook_destroy): free model->query. * gui/component/select-names/e-select-names-manager.c (load_completion_books): use e_book_expand_uri here, and free the expanded uri after calling addressbook_load_uri, plugging a leak. * gui/component/select-names/e-select-names.c (set_book): unref esn->model before we unref esn. fixes an edge case memory corruption bug. (clear_widget): utility function to set a widget's ref to NULL when it's destroyed. (e_select_names_init): hook the status_message, categories option menu, and select_entry to clear_widget. (addressbook_model_set_uri): use e_book_expand_uri. svn path=/trunk/; revision=18217 --- addressbook/ChangeLog | 21 +++++++++++++++++++++ .../component/select-names/e-select-names-manager.c | 9 +++++---- addressbook/gui/widgets/e-addressbook-model.c | 2 ++ .../gui/widgets/e-addressbook-table-adapter.c | 2 ++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index b537bf43ea..5e63a1842e 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,24 @@ +2002-09-23 Chris Toshok + + * gui/widgets/e-addressbook-table-adapter.c (addressbook_destroy): + free adapter->priv. + + * gui/widgets/e-addressbook-model.c (addressbook_destroy): free + model->query. + + * gui/component/select-names/e-select-names-manager.c + (load_completion_books): use e_book_expand_uri here, and free the + expanded uri after calling addressbook_load_uri, plugging a leak. + + * gui/component/select-names/e-select-names.c (set_book): unref + esn->model before we unref esn. fixes an edge case memory + corruption bug. + (clear_widget): utility function to set a widget's ref to NULL + when it's destroyed. + (e_select_names_init): hook the status_message, categories option + menu, and select_entry to clear_widget. + (addressbook_model_set_uri): use e_book_expand_uri. + 2002-09-23 JP Rosevear * conduit/Makefile.am: add libeutil to the link and link with diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c index 5c24e482fa..9bc06b52d9 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.c +++ b/addressbook/gui/component/select-names/e-select-names-manager.c @@ -23,6 +23,7 @@ #include "e-select-names-completion.h" #include "e-select-names-popup.h" #include "e-folder-list.h" +#include #include #include #include @@ -396,11 +397,11 @@ load_completion_books (ESelectNamesManager *manager) EBook *book = e_book_new (); gtk_object_ref (GTK_OBJECT (manager)); /* ref ourself before our async call */ - if (!strncmp (f->physical_uri, "file:", 5)) - uri = g_strdup_printf ("%s/addressbook.db", f->physical_uri); - else - uri = g_strdup (f->physical_uri); + uri = e_book_expand_uri (f->physical_uri); + addressbook_load_uri (book, uri, (EBookCallback)open_book_cb, manager); + + g_free (uri); } e_folder_list_free_items (folders); } diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index 7f59c2313c..9244df8a38 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -125,6 +125,8 @@ addressbook_destroy(GtkObject *object) gtk_object_unref(GTK_OBJECT(model->book)); model->book = NULL; } + + g_free (model->query); } static void diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index 08c03863aa..abcaf6e6b0 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -85,6 +85,8 @@ addressbook_destroy(GtkObject *object) EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(object); unlink_model(adapter); + + g_free (adapter->priv); } /* This function returns the number of columns in our ETableModel. */ -- cgit