Only deregister component if registry still exists

This commit is contained in:
John Garland 2011-07-05 17:58:18 +10:00
parent f75ec9d484
commit cf891125e6
1 changed files with 2 additions and 1 deletions

View File

@ -99,7 +99,8 @@ class Component(object):
_ComponentRegistry.register(self) _ComponentRegistry.register(self)
def __del__(self): def __del__(self):
_ComponentRegistry.deregister(self) if _ComponentRegistry:
_ComponentRegistry.deregister(self)
def _component_start_timer(self): def _component_start_timer(self):
if hasattr(self, "update"): if hasattr(self, "update"):