From e8715cd56136acfe5bd9fd2b75ab4c98e9c62231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 30 Jul 2013 11:58:34 +0200 Subject: [PATCH] release qubes.xml lock on object destroy This will ensure that lock will be released even in case of error. --- core/qubes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/qubes.py b/core/qubes.py index af225f02..4ff20dd1 100755 --- a/core/qubes.py +++ b/core/qubes.py @@ -291,6 +291,10 @@ class QubesVmCollection(dict): def __repr__(self): return '<{} {!r}>'.format(self.__class__.__name__, list(sorted(self.keys()))) + def __del__(self): + if self.qubes_store_file_lock.i_am_locking(): + self.qubes_store_file_lock.release() + def values(self): for qid in self.keys(): yield self[qid]