diff options
author | Dan Winship <danw@src.gnome.org> | 2003-07-18 00:58:02 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2003-07-18 00:58:02 +0800 |
commit | 9bcb908ca516ac24874af94ab2a5acc9af437170 (patch) | |
tree | d682c734b40552631413af10ccaefdcf85bc8750 /addressbook | |
parent | 732db2157efe52e897004904abf94585eab766b1 (diff) | |
download | gsoc2013-evolution-9bcb908ca516ac24874af94ab2a5acc9af437170.tar gsoc2013-evolution-9bcb908ca516ac24874af94ab2a5acc9af437170.tar.gz gsoc2013-evolution-9bcb908ca516ac24874af94ab2a5acc9af437170.tar.bz2 gsoc2013-evolution-9bcb908ca516ac24874af94ab2a5acc9af437170.tar.lz gsoc2013-evolution-9bcb908ca516ac24874af94ab2a5acc9af437170.tar.xz gsoc2013-evolution-9bcb908ca516ac24874af94ab2a5acc9af437170.tar.zst gsoc2013-evolution-9bcb908ca516ac24874af94ab2a5acc9af437170.zip |
disconnect from model signals to prevent a race condition at shutdown
* gui/widgets/e-addressbook-view.c (e_addressbook_view_dispose):
disconnect from model signals to prevent a race condition at
shutdown where the view gets destroyed and then the model notices
the backend dying before being destroyed itself.
* gui/widgets/e-addressbook-reflow-adapter.c
(addressbook_finalize): add, to free priv.
(e_addressbook_reflow_adapter_class_init): set it up
* gui/component/e-address-popup.c (e_address_popup_set_free_form):
Don't leak strings
* gui/component/addressbook-storage.c (load_source_data): don't
leak xml data.
* gui/component/addressbook-component.c (new_item_cb): don't leak
the new card.
svn path=/trunk/; revision=21858
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 20 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 9 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-storage.c | 14 | ||||
-rw-r--r-- | addressbook/gui/component/e-address-popup.c | 3 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-reflow-adapter.c | 9 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 4 |
6 files changed, 53 insertions, 6 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 801f39ac6c..402dcdd6ea 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,23 @@ +2003-06-30 Dan Winship <danw@ximian.com> + + * gui/widgets/e-addressbook-view.c (e_addressbook_view_dispose): + disconnect from model signals to prevent a race condition at + shutdown where the view gets destroyed and then the model notices + the backend dying before being destroyed itself. + + * gui/widgets/e-addressbook-reflow-adapter.c + (addressbook_finalize): add, to free priv. + (e_addressbook_reflow_adapter_class_init): set it up + + * gui/component/e-address-popup.c (e_address_popup_set_free_form): + Don't leak strings + + * gui/component/addressbook-storage.c (load_source_data): don't + leak xml data. + + * gui/component/addressbook-component.c (new_item_cb): don't leak + the new card. + 2003-06-25 Gilbert Fang <gilbert.fang@sun.com> * gui/widgets/e-minicard-view-widget.c diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index f90df5f65a..b49dec3005 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -407,12 +407,17 @@ static void new_item_cb (EBook *book, gpointer closure) { gboolean is_list = GPOINTER_TO_INT (closure); + ECard *card; + if (book == NULL) return; + + card = e_card_new (""); if (is_list) - e_addressbook_show_contact_list_editor (book, e_card_new(""), TRUE, TRUE); + e_addressbook_show_contact_list_editor (book, card, TRUE, TRUE); else - e_addressbook_show_contact_editor (book, e_card_new(""), TRUE, TRUE); + e_addressbook_show_contact_editor (book, card, TRUE, TRUE); + g_object_unref (card); } static void diff --git a/addressbook/gui/component/addressbook-storage.c b/addressbook/gui/component/addressbook-storage.c index 6f087b6c7e..f877dd3cd6 100644 --- a/addressbook/gui/component/addressbook-storage.c +++ b/addressbook/gui/component/addressbook-storage.c @@ -443,7 +443,7 @@ load_source_data (const char *file_path) } for (child = root->children; child; child = child->next) { - char *path; + char *path, *value; AddressbookSource *source; source = g_new0 (AddressbookSource, 1); @@ -452,9 +452,15 @@ load_source_data (const char *file_path) source->port = get_string_value (child, "port"); source->host = get_string_value (child, "host"); source->rootdn = get_string_value (child, "rootdn"); - source->scope = ldap_parse_scope (get_string_value (child, "scope")); - source->auth = ldap_parse_auth (get_string_value (child, "authmethod")); - source->ssl = ldap_parse_ssl (get_string_value (child, "ssl")); + value = get_string_value (child, "scope"); + source->scope = ldap_parse_scope (value); + g_free (value); + value = get_string_value (child, "authmethod"); + source->auth = ldap_parse_auth (value); + g_free (value); + value = get_string_value (child, "ssl"); + source->ssl = ldap_parse_ssl (value); + g_free (value); source->email_addr = get_string_value (child, "emailaddr"); source->binddn = get_string_value (child, "binddn"); source->limit = get_integer_value (child, "limit", 100); diff --git a/addressbook/gui/component/e-address-popup.c b/addressbook/gui/component/e-address-popup.c index 0b5ec97185..9d87fd0fb3 100644 --- a/addressbook/gui/component/e-address-popup.c +++ b/addressbook/gui/component/e-address-popup.c @@ -836,6 +836,9 @@ e_address_popup_set_free_form (EAddressPopup *pop, const gchar *txt) e_address_popup_set_name (pop, name); e_address_popup_set_email (pop, email); + g_free (name); + g_free (email); + return TRUE; } diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 7f99062144..7ece1aab8c 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -107,6 +107,14 @@ addressbook_dispose(GObject *object) } static void +addressbook_finalize(GObject *object) +{ + EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object); + + g_free (adapter->priv); +} + +static void addressbook_set_width (EReflowModel *erm, int width) { } @@ -373,6 +381,7 @@ e_addressbook_reflow_adapter_class_init (GObjectClass *object_class) object_class->set_property = addressbook_set_property; object_class->get_property = addressbook_get_property; object_class->dispose = addressbook_dispose; + object_class->finalize = addressbook_finalize; g_object_class_install_property (object_class, PROP_BOOK, g_param_spec_object ("book", diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 35decd7ee2..08710c71b5 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -326,6 +326,10 @@ e_addressbook_view_dispose (GObject *object) EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object); if (eav->model) { + g_signal_handlers_disconnect_matched (eav->model, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, + object); g_object_unref (eav->model); eav->model = NULL; } |