Only deregister component if the registry still exists

This commit is contained in:
John Garland 2011-07-05 17:43:55 +10:00
parent ff087d133c
commit 18ebf5b912
1 changed files with 2 additions and 1 deletions

View File

@ -97,6 +97,7 @@ class Component(object):
_ComponentRegistry.register(self) _ComponentRegistry.register(self)
def __del__(self): def __del__(self):
if _ComponentRegistry:
_ComponentRegistry.deregister(self._component_name) _ComponentRegistry.deregister(self._component_name)
def _component_start_timer(self): def _component_start_timer(self):