diff options
author | Cole Robinson <crobinso@redhat.com> | 2018-03-17 19:42:19 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2018-03-17 19:42:19 -0400 |
commit | 4d4a07c65b72bb7976efba71f21b29f4c073e95c (patch) | |
tree | 635cf812f3d4223e10c6d15f38632d5517981ad9 /virtManager/baseclass.py | |
parent | 259c70a090933f356c290597d56079799cd54ac0 (diff) | |
download | virt-manager-4d4a07c65b72bb7976efba71f21b29f4c073e95c.tar.gz |
tests: uitests: Add window cleanup tests
And fix some bugs I found as a result
Diffstat (limited to 'virtManager/baseclass.py')
-rw-r--r-- | virtManager/baseclass.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/virtManager/baseclass.py b/virtManager/baseclass.py index 6e0402c8..077a95ac 100644 --- a/virtManager/baseclass.py +++ b/virtManager/baseclass.py @@ -41,7 +41,7 @@ class vmmGObject(GObject.GObject): _instance = None # windowlist mapping, if applicable (vmmDetails, vmmHost, ...) - _instances = {} + _instances = None # This saves a bunch of imports and typing RUN_FIRST = GObject.SignalFlags.RUN_FIRST @@ -91,9 +91,11 @@ class vmmGObject(GObject.GObject): # We set this to True which can help us catch instances # where cleanup routines try to reinit singleton classes self.__class__._instance = True - for k, v in list(self.__class__._instances.items()): + + _instances = self.__class__._instances or {} + for k, v in list(_instances.items()): if v == self: - self.__class__._instances.pop(k) + _instances.pop(k) self._cleanup() |