mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 12:12:10 -04:00
added destroy for functors and param sets
This commit is contained in:
parent
75ecd2cf92
commit
927e52a363
@ -756,6 +756,13 @@ class Functor:
|
||||
self.__name__ = 'Functor: %s' % self._function.__name__
|
||||
self.__doc__ = self._function.__doc__
|
||||
|
||||
def destroy(self):
|
||||
del self._function
|
||||
del self._args
|
||||
del self._kargs
|
||||
del self.__name__
|
||||
del self.__doc__
|
||||
|
||||
def __call__(self, *args, **kargs):
|
||||
"""call function"""
|
||||
_args = list(self._args)
|
||||
@ -1112,6 +1119,12 @@ class ParamObj:
|
||||
if params is not None:
|
||||
params.applyTo(self)
|
||||
|
||||
def destroy(self):
|
||||
for param in self.ParamSet.getParams():
|
||||
setterName = getSetterName(param)
|
||||
self.__dict__[setterName].destroy()
|
||||
del self.__dict__[setterName]
|
||||
|
||||
def setDefaultParams(self):
|
||||
# set all the default parameters on ourself
|
||||
self.ParamSet().applyTo(self)
|
||||
|
Loading…
x
Reference in New Issue
Block a user