diff options
author | Chris Toshok <toshok@ximian.com> | 2003-04-20 06:18:16 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-04-20 06:18:16 +0800 |
commit | 1cbbf5ab2299d70afdffdd584562fd8650409693 (patch) | |
tree | e853bd7f5928002d5701206d449c197ad96f9b83 | |
parent | a17a25e3496d7ce1bbd57a763076c446b78bdb70 (diff) | |
download | gsoc2013-evolution-1cbbf5ab2299d70afdffdd584562fd8650409693.tar.gz gsoc2013-evolution-1cbbf5ab2299d70afdffdd584562fd8650409693.tar.zst gsoc2013-evolution-1cbbf5ab2299d70afdffdd584562fd8650409693.zip |
[ fixes bug #40954 ] guard against NULL bf->priv->summary (happens if the
2003-04-19 Chris Toshok <toshok@ximian.com>
[ 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
-rw-r--r-- | addressbook/ChangeLog | 13 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-file.c | 12 |
2 files changed, 18 insertions, 7 deletions
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 <toshok@ximian.com> +2003-04-19 Chris Toshok <toshok@ximian.com> + + [ 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 <toshok@ximian.com> [ 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); |