about summary refs log tree commit diff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-05-01T15·16+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-05-01T15·16+0000
commitcbfac2fdccc83b04d9c2027e9e21070d4ac7c7e5 (patch)
tree9bff2f93fb123a3ad05bb3712e3d2a875c6da53b /src/libstore/local-store.cc
parent644946feed146396c00c288337bad26428970aa4 (diff)
* Set a terminate() handler to ensure that we leave the BDB
  environment cleanly even when an exception is thrown from a
  destructor.  We still crash, but we don't take all other Nix
  processes with us.

Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 7b7efc84b3..cd8bc1a339 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -161,7 +161,11 @@ LocalStore::LocalStore(bool reserveSpace)
 LocalStore::~LocalStore()
 {
     /* If the database isn't open, this is a NOP. */
-    nixDB.close();
+    try {
+        nixDB.close();
+    } catch (...) {
+        ignoreException();
+    }
 }