new-contact-fix.patch 1.1 KB

1234567891011121314151617181920212223
  1. When contacts called for the 1st time, adding new contact always failed but
  2. worked after restart. The reason is e-addressbook-factory used to handle
  3. addressbook leads a segmentation fault. Root cause is that factory would create
  4. the data base if not exist, but use it without proper initialization.
  5. This patch fix it.
  6. Upstream-Status: Submitted
  7. Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
  8. Index: git/addressbook/backends/file/e-book-backend-file.c
  9. ===================================================================
  10. --- git.orig/addressbook/backends/file/e-book-backend-file.c 2010-10-20 16:14:31.000000000 +0800
  11. +++ git/addressbook/backends/file/e-book-backend-file.c 2010-10-22 14:11:47.000000000 +0800
  12. @@ -1217,6 +1217,8 @@
  13. EContact *contact = NULL;
  14. EBookBackendSyncStatus status;
  15. + /* Initialize file_db, or else following do_create cause seg fault */
  16. + bf->priv->file_db = db;
  17. status = do_create (bf, XIMIAN_VCARD, &contact);
  18. if (status != GNOME_Evolution_Addressbook_Success)
  19. g_warning ("Cannot create default contact: %d", status);