about summary refs log tree commit diff
path: root/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r--src/libstore/pathlocks.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index df1f0b1e3831..f8753bcb66e0 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -204,6 +204,12 @@ void PathLocks::lockPaths(const PathSet & _paths, const string & waitMsg)
 
 PathLocks::~PathLocks()
 {
+    unlock();
+}
+
+
+void PathLocks::unlock()
+{
     for (list<FDPair>::iterator i = fds.begin(); i != fds.end(); i++) {
         if (deletePaths) deleteLockFilePreClose(i->second, i->first);
 
@@ -216,6 +222,8 @@ PathLocks::~PathLocks()
 
         debug(format("lock released on `%1%'") % i->second);
     }
+
+    fds.clear();
 }