protected virtual void Dispose(bool disposing) { if (!_isDisposed) { _isDisposed = true; if (!_preventDelete) { //IntPtr userPtr = UnsafeNativeMethods.btCollisionShape_getUserPointer(Native); //GCHandle.FromIntPtr(userPtr).Free(); UnsafeNativeMethodsInverseDynamics.MultiBodyTree_delete(Native); } } }