Ver Fonte

bullet: Fix `BulletWheel::empty()` referencing local objects

rdb há 3 anos atrás
pai
commit
ef9c9fa20e

+ 0 - 14
panda/src/bullet/bulletWheel.I

@@ -26,17 +26,3 @@ INLINE BulletWheelRaycastInfo::
 ~BulletWheelRaycastInfo() {
 ~BulletWheelRaycastInfo() {
 
 
 }
 }
-
-/**
- * Named constructor intended to be used for asserts with have to return a
- * concrete value.
- */
-INLINE BulletWheel BulletWheel::
-empty() {
-
-  btWheelInfoConstructionInfo ci {};
-  btWheelInfo info(ci);
-
-  return BulletWheel(info);
-}
-

+ 13 - 0
panda/src/bullet/bulletWheel.cxx

@@ -23,6 +23,19 @@ BulletWheel(btWheelInfo &info) : _info(info) {
 
 
 }
 }
 
 
+/**
+ * Named constructor intended to be used for asserts with have to return a
+ * concrete value.
+ */
+BulletWheel BulletWheel::
+empty() {
+
+  static btWheelInfoConstructionInfo ci {};
+  static btWheelInfo info(ci);
+
+  return BulletWheel(info);
+}
+
 /**
 /**
  *
  *
  */
  */

+ 1 - 1
panda/src/bullet/bulletWheel.h

@@ -143,7 +143,7 @@ PUBLISHED:
 public:
 public:
   BulletWheel(btWheelInfo &info);
   BulletWheel(btWheelInfo &info);
 
 
-  INLINE static BulletWheel empty();
+  static BulletWheel empty();
 
 
 private:
 private:
   btWheelInfo &_info;
   btWheelInfo &_info;