- remove wheel finalization completely, need no deletion..

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8496 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 5080e3fe43
commit 4ba3abcda9
  1. 10
      engine/src/bullet/com/jme3/bullet/objects/VehicleWheel.java
  2. 11
      engine/src/bullet/native/com_jme3_bullet_objects_VehicleWheel.cpp

@ -416,14 +416,4 @@ public class VehicleWheel implements Savable {
this.applyLocal = applyLocal;
}
@Override
protected void finalize() throws Throwable {
super.finalize();
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Finalizing Wheel {0}", Long.toHexString(wheelId));
// if (wheelId != 0 && wheelIndex != 0) {
// finalizeNative(wheelId, wheelIndex);
// }
}
private native void finalizeNative(long wheelId, int wheelIndex);
}

@ -142,17 +142,6 @@ extern "C" {
return vehicle->getWheelInfo(wheelIndex).m_skidInfo;
}
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_VehicleWheel_finalizeNative
(JNIEnv *env, jobject object, jlong vehicleId, jint wheelIndex) {
btRaycastVehicle* vehicle = reinterpret_cast<btRaycastVehicle*>(vehicleId);
if (vehicle == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
btWheelInfo m_wheelInfo[wheelIndex];
delete(&m_wheelInfo);
}
#ifdef __cplusplus
}
#endif

Loading…
Cancel
Save