Browse Source

Reset the db to 0 after closing it.

This avoids closing it again and possibly crashing

Maybe the cause of the crash described in
https://github.com/owncloud/mirall/issues/1229
Olivier Goffart 12 years ago
parent
commit
3590db47ac
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/csync.c

+ 2 - 0
src/csync.c

@@ -706,6 +706,7 @@ int csync_commit(CSYNC *ctx) {
     CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "ERR: closing of statedb failed.");
     rc = -1;
   }
+  ctx->statedb.db = NULL;
 
   rc = csync_vio_commit(ctx);
   if (rc < 0) {
@@ -761,6 +762,7 @@ int csync_destroy(CSYNC *ctx) {
     CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "ERR: closing of statedb failed.");
     rc = -1;
   }
+  ctx->statedb.db = NULL;
 
   csync_vio_shutdown(ctx);