[evolution-data-server] Fix for bug #588220
- From: Jeff Cai <jeffcai src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution-data-server] Fix for bug #588220
- Date: Thu, 16 Jul 2009 10:13:45 +0000 (UTC)
commit 3665f8032930a7ac0447f7235108146c465f3571
Author: Jeff Cai <jeff cai sun com>
Date: Thu Jul 16 18:11:47 2009 +0800
Fix for bug #588220
If xOpen failed, queue and thread should not be created
camel/camel-db.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/camel/camel-db.c b/camel/camel-db.c
index be63c5b..d72e44a 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -270,6 +270,13 @@ camel_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs, const gchar *zPath, sqlite3_file *pF
cFile = (CamelSqlite3File *)pFile;
cFile->old_vfs_file = g_malloc0 (old_vfs->szOsFile);
+
+ res = old_vfs->xOpen (old_vfs, zPath, cFile->old_vfs_file, flags, pOutFlags);
+ if (res != SQLITE_OK) {
+ g_free (cFile->old_vfs_file);
+ return res;
+ }
+
cFile->queue = g_async_queue_new ();
/* Spawn a joinable thread to listen for sync requests. */
@@ -280,11 +287,6 @@ camel_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs, const gchar *zPath, sqlite3_file *pF
g_error_free (error);
}
- res = old_vfs->xOpen (old_vfs, zPath, cFile->old_vfs_file, flags, pOutFlags);
-
- if (res != SQLITE_OK)
- return res;
-
g_static_rec_mutex_lock (&only_once_lock);
/* cFile->old_vfs_file->pMethods is NULL when open failed for some reason,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]