respect delayDelete when removing objects from cache

This commit is contained in:
David Rose 2002-10-28 17:47:53 +00:00
parent 54e997dbe0
commit 6a7e96398d
2 changed files with 7 additions and 6 deletions

View File

@ -19,7 +19,7 @@ class CRCache:
assert(self.checkCache())
CRCache.notify.debug("Flushing the cache")
for distObj in self.dict.values():
distObj.delete()
distObj.deleteOrDelay()
# Null out all references to the objects so they will get gcd
self.dict = {}
self.fifo = []
@ -48,7 +48,7 @@ class CRCache:
# and remove it from the dictionary
del(self.dict[oldestDistObj.getDoId()])
# and delete it
oldestDistObj.delete()
oldestDistObj.deleteOrDelay()
# Make sure that the fifo and the dictionary are sane
assert(len(self.dict) == len(self.fifo))
@ -81,7 +81,7 @@ class CRCache:
del(self.dict[doId])
self.fifo.remove(distObj)
# and delete it
distObj.delete()
distObj.deleteOrDelay()
def checkCache(self):
# For debugging; this verifies that the cache is sensible and

View File

@ -123,9 +123,10 @@ class DistributedObject(PandaObject):
# a normal, nondisabled state; and *then* the disable function
# can properly disable it (for instance, by parenting it to
# hidden).
self.activeState = ESDisabling
messenger.send(self.uniqueName("disable"))
self.disable()
if self.activeState != ESDisabled:
self.activeState = ESDisabling
messenger.send(self.uniqueName("disable"))
self.disable()
return None
def announceGenerate(self):