release qubes.xml lock on object destroy

This will ensure that lock will be released even in case of error.
This commit is contained in:
Marek Marczykowski-Górecki 2013-07-30 11:58:34 +02:00
parent 50188c8832
commit e8715cd561

View File

@ -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]