prevent name conflicts: EnforcesCalldowns.destroy()->EC_destroy()

This commit is contained in:
Darren Ranalli 2006-09-30 00:08:00 +00:00
parent d244387ec3
commit 1983748912
2 changed files with 4 additions and 3 deletions

View File

@ -255,7 +255,7 @@ class DistributedObject(DistributedObjectBase, EnforcesCalldowns):
self.DistributedObject_deleted = 1 self.DistributedObject_deleted = 1
self.cr = None self.cr = None
self.dclass = None self.dclass = None
EnforcesCalldowns.destroy(self) EnforcesCalldowns.EC_destroy(self)
@calldownEnforced @calldownEnforced
def generate(self): def generate(self):

View File

@ -2459,9 +2459,10 @@ class EnforcesCalldowns:
Functor(EnforcesCalldowns._enforceCalldowns, oldMethod, name), Functor(EnforcesCalldowns._enforceCalldowns, oldMethod, name),
self, self.__class__)) self, self.__class__))
def destroy(self): def EC_destroy(self):
if not __debug__:
return
# this must be called on destruction to prevent memory leaks # this must be called on destruction to prevent memory leaks
#import pdb;pdb.set_trace()
for name in self._obscuredMethodNames: for name in self._obscuredMethodNames:
delattr(self, name) delattr(self, name)
del self._obscuredMethodNames del self._obscuredMethodNames