From 22fd93e50fe939b667c029b5b18660608606c706 Mon Sep 17 00:00:00 2001 From: Jesse Schell Date: Wed, 21 Mar 2001 22:22:14 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/showbase/Messenger.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/direct/src/showbase/Messenger.py b/direct/src/showbase/Messenger.py index bcb728423b..0b2db3b88f 100644 --- a/direct/src/showbase/Messenger.py +++ b/direct/src/showbase/Messenger.py @@ -121,10 +121,14 @@ class Messenger: # If this object was only accepting this event once, # remove it from the dictionary if not persistent: - del acceptorDict[object] - # If this dictionary is now empty, remove the event - # entry from the Messenger alltogether - if (len(acceptorDict) == 0): + # We need to check this because the apply above might + # have done an ignore. + if acceptorDict.has_key(object): + del acceptorDict[object] + # If this dictionary is now empty, remove the event + # entry from the Messenger alltogether + if ((len(acceptorDict) == 0) and + (self.dict.has_key(event))): del self.dict[event] def clear(self):