From e1c916cdc3634ec9ccd869dd810f2f412b4607a8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 2 Apr 2017 14:44:51 +0200 Subject: [PATCH] interrogate: handle implicit destructors correctly --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 3 ++- dtool/src/interrogatedb/interrogateType.I | 8 ++++++++ dtool/src/interrogatedb/interrogateType.h | 1 + dtool/src/parser-inc/btBulletDynamicsCommon.h | 5 +++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index e4dbfd4084..6ca45df628 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1133,7 +1133,8 @@ write_class_declarations(ostream &out, ostream *out_h, Object *obj) { // to a macro function. out << "typedef " << c_class_name << " " << class_name << "_localtype;\n"; if (obj->_itype.has_destructor() || - obj->_itype.destructor_is_inherited()) { + obj->_itype.destructor_is_inherited() || + obj->_itype.destructor_is_implicit()) { if (TypeManager::is_reference_count(type)) { out << "Define_Module_ClassRef"; diff --git a/dtool/src/interrogatedb/interrogateType.I b/dtool/src/interrogatedb/interrogateType.I index f6037fc571..b5527bbd23 100644 --- a/dtool/src/interrogatedb/interrogateType.I +++ b/dtool/src/interrogatedb/interrogateType.I @@ -343,6 +343,14 @@ destructor_is_inherited() const { return (_flags & F_inherited_destructor) != 0; } +/** + * + */ +INLINE bool InterrogateType:: +destructor_is_implicit() const { + return (_flags & F_implicit_destructor) != 0; +} + /** * */ diff --git a/dtool/src/interrogatedb/interrogateType.h b/dtool/src/interrogatedb/interrogateType.h index a1cedd1d82..151e10b5f5 100644 --- a/dtool/src/interrogatedb/interrogateType.h +++ b/dtool/src/interrogatedb/interrogateType.h @@ -82,6 +82,7 @@ public: INLINE FunctionIndex get_constructor(int n) const; INLINE bool has_destructor() const; INLINE bool destructor_is_inherited() const; + INLINE bool destructor_is_implicit() const; INLINE FunctionIndex get_destructor() const; INLINE int number_of_elements() const; INLINE ElementIndex get_element(int n) const; diff --git a/dtool/src/parser-inc/btBulletDynamicsCommon.h b/dtool/src/parser-inc/btBulletDynamicsCommon.h index f62fc5bee6..aaf2309f4d 100644 --- a/dtool/src/parser-inc/btBulletDynamicsCommon.h +++ b/dtool/src/parser-inc/btBulletDynamicsCommon.h @@ -65,7 +65,6 @@ class btPoint2PointConstraint; class btPolyhedralConvexShape; class btQuaternion; class btSequentialImpulseConstraintSolver; -class btScalar; class btSliderConstraint; class btSoftBodyHelpers; class btSoftBodyRigidBodyCollisionConfiguration; @@ -80,11 +79,13 @@ class btTranslationalLimitMotor; class btTriangleMesh; class btTypedConstraint; class btTypedObject; -class btVector3; class btVehicleRaycaster; template class btAlignedObjectArray; +struct btVector3 {}; +typedef double btScalar; + class btWheelInfo { public: class RaycastInfo;