From 3fcd37e21c74380bedb7e9268c4f3a4a70a3a6b5 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Fri, 26 May 2006 00:54:20 +0000 Subject: [PATCH] auto-destroy --- direct/src/showbase/BulletinBoardWatcher.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/direct/src/showbase/BulletinBoardWatcher.py b/direct/src/showbase/BulletinBoardWatcher.py index 677b7406be..65b74b2b1f 100755 --- a/direct/src/showbase/BulletinBoardWatcher.py +++ b/direct/src/showbase/BulletinBoardWatcher.py @@ -31,8 +31,9 @@ class BulletinBoardWatcher(DirectObject.DirectObject): def destroy(self): self.ignoreAll() - del self.callback - del self.waitingOn + if hasattr(self, 'callback'): + del self.callback + del self.waitingOn def isDone(self): return len(self.waitingOn) == 0 @@ -41,6 +42,7 @@ class BulletinBoardWatcher(DirectObject.DirectObject): if self.isDone(): self.notify.debug('%s: done' % self.name) self.callback() + self.destroy() def _handleEvent(self, eventName): self.notify.debug('%s: handlePost(%s)' % (self.name, eventName))