From 41359848c0c906656b910c1de6079e6cc99abfda Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Fri, 30 Mar 2001 08:31:06 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/ffi/FFISpecs.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/direct/src/ffi/FFISpecs.py b/direct/src/ffi/FFISpecs.py index 5c27faa84e..567be4a4d9 100644 --- a/direct/src/ffi/FFISpecs.py +++ b/direct/src/ffi/FFISpecs.py @@ -330,9 +330,13 @@ class MethodSpecification(FunctionSpecification): # The method body will look something like # panda.Class_destructor(self.this) self.outputCFunctionComment(file, nesting+2) - indent(file, nesting+2, 'if ' + self.typeDescriptor.moduleName + ':\n') - indent(file, nesting+3, self.typeDescriptor.moduleName + '.' - + self.typeDescriptor.wrapperName + '(self.this)\n') + functionName = (self.typeDescriptor.moduleName + '.' + + self.typeDescriptor.wrapperName) + # Make sure the module and function have not been deleted first + # This only happens during shutdown + indent(file, nesting+2, 'if (' + self.typeDescriptor.moduleName + ' and ' + + functionName + '):\n') + indent(file, nesting+3, functionName + '(self.this)\n') def outputDestructorFooter(self, methodClass, file, nesting): indent(file, nesting+1, '\n')