[Pkg-javascript-commits] [node-leveldown] 02/23: Don't die when	reopening DB.
    Andrew Kelley 
    andrewrk-guest at moszumanska.debian.org
       
    Sun Jul  6 17:21:52 UTC 2014
    
    
  
This is an automated email from the git hooks/post-receive script.
andrewrk-guest pushed a commit to tag hyper-0.10.2
in repository node-leveldown.
commit adb8cfccf6f0a825140a5af37d1bdf3542a54961
Author: Geoff Greer <geoff at greer.fm>
Date:   Tue Jan 14 16:21:56 2014 -0800
    Don't die when reopening DB.
---
 src/database.cc | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/src/database.cc b/src/database.cc
index 31c9450..d552afa 100644
--- a/src/database.cc
+++ b/src/database.cc
@@ -26,6 +26,7 @@ Database::Database (char* location) : location(location) {
   db = NULL;
   currentIteratorId = 0;
   pendingCloseWorker = NULL;
+  openOptions = NULL;
 };
 
 Database::~Database () {
@@ -117,6 +118,9 @@ void Database::ReleaseIterator (uint32_t id) {
 void Database::CloseDatabase () {
   delete db;
   db = NULL;
+  if (openOptions == NULL) {
+    return;
+  }
   if (openOptions->block_cache) {
     delete openOptions->block_cache;
     openOptions->block_cache = NULL;
@@ -126,6 +130,7 @@ void Database::CloseDatabase () {
     openOptions->filter_policy = NULL;
   }
   delete openOptions;
+  openOptions = NULL;
 }
 
 /* V8 exposed functions *****************************/
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-leveldown.git
    
    
More information about the Pkg-javascript-commits
mailing list