about summary refs log tree commit diff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-11-19T16·07+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-11-19T16·07+0100
commit1256ab3b446d8e35225c36e71abb50ee964ea050 (patch)
tree6cca5bb797379a3966aa9ec92fc48fc3f73266fe /src/libstore/local-store.cc
parented306febb586a005b86a0ade2485c3c932698314 (diff)
Clean up temp roots in a more C++ way
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index f08c877fe3d7..fc48c0405650 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -363,6 +363,15 @@ LocalStore::~LocalStore()
     } catch (...) {
         ignoreException();
     }
+
+    try {
+        if (fdTempRoots != -1) {
+            fdTempRoots.close();
+            unlink(fnTempRoots.c_str());
+        }
+    } catch (...) {
+        ignoreException();
+    }
 }