Sfoglia il codice sorgente

release qubes.xml lock on object destroy

This will ensure that lock will be released even in case of error.
Marek Marczykowski-Górecki 11 anni fa
parent
commit
e8715cd561
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      core/qubes.py

+ 4 - 0
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]