fix for issue #913

accellbaker
Stephen Gold 6 years ago
parent 499714507b
commit 618337a81d
  1. 18
      jme3-bullet-native/src/native/cpp/com_jme3_bullet_joints_PhysicsJoint.cpp

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2012 jMonkeyEngine
* Copyright (c) 2009-2018 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -56,6 +56,22 @@ extern "C" {
return joint->getAppliedImpulse();
}
/*
* Class: com_jme3_bullet_joints_PhysicsJoint
* Method: finalizeNative
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_jme3_bullet_joints_PhysicsJoint_finalizeNative
(JNIEnv * env, jobject object, jlong jointId) {
btTypedConstraint* joint = reinterpret_cast<btTypedConstraint*> (jointId);
if (joint == NULL) {
jclass newExc = env->FindClass("java/lang/NullPointerException");
env->ThrowNew(newExc, "The native object does not exist.");
return;
}
delete(joint);
}
#ifdef __cplusplus
}
#endif

Loading…
Cancel
Save