From 1cbbf5ab2299d70afdffdd584562fd8650409693 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 19 Apr 2003 22:18:16 +0000 Subject: [ fixes bug #40954 ] guard against NULL bf->priv->summary (happens if the 2003-04-19 Chris Toshok [ fixes bug #40954 ] * backend/pas/pas-backend-file.c (pas_backend_file_dispose): guard against NULL bf->priv->summary (happens if the initial load_uri failed). (pas_backend_file_load_uri): always set bf->priv->uri, since it's used in _get_uri, which is called when the backend goes away. This only happened before if you tried to load a folder that didn't exist. svn path=/trunk/; revision=20898 --- addressbook/ChangeLog | 13 ++++++++++++- addressbook/backend/pas/pas-backend-file.c | 12 ++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 8743cd24a9..691aeea2e8 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,4 +1,15 @@ -2003-04-16 Chris Toshok +2003-04-19 Chris Toshok + + [ fixes bug #40954 ] + * backend/pas/pas-backend-file.c (pas_backend_file_dispose): guard + against NULL bf->priv->summary (happens if the initial load_uri + failed). + (pas_backend_file_load_uri): always set bf->priv->uri, since it's + used in _get_uri, which is called when the backend goes away. + This only happened before if you tried to load a folder that + didn't exist. + +2003-04-19 Chris Toshok [ fixes #40694 ] * gui/component/select-names/e-select-names-bonobo.c diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index 06eb84cc4e..b11c62cb86 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -395,8 +395,7 @@ pas_backend_file_search_timeout (gpointer data) while (db_error == 0) { /* don't include the version in the list of cards */ - if (id_dbt.size != file_version_name_len+1 - || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) { + if (strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) { char *vcard_string = vcard_dbt.data; /* check if the vcard matches the search sexp */ @@ -1378,6 +1377,9 @@ pas_backend_file_load_uri (PASBackend *backend, struct stat sb; char *summary_filename; + g_free(bf->priv->uri); + bf->priv->uri = g_strdup (uri); + db_version (&major, &minor, &patch); if (major != 3 || @@ -1450,9 +1452,6 @@ pas_backend_file_load_uri (PASBackend *backend, return GNOME_Evolution_Addressbook_BookListener_OtherError; } - g_free(bf->priv->uri); - bf->priv->uri = g_strdup (uri); - g_free (bf->priv->filename); bf->priv->filename = filename; @@ -1536,7 +1535,8 @@ pas_backend_file_dispose (GObject *object) if (bf->priv) { g_object_unref(bf->priv->book_views); - g_object_unref(bf->priv->summary); + if (bf->priv->summary) + g_object_unref(bf->priv->summary); g_free (bf->priv->uri); g_free (bf->priv->filename); -- cgit v1.2.3