one thing to try at least would be to wrap it up with a quick validity check.
if that works, then i would look at if its possible that its being called twice. this of course assumes that in your code somewhere after calling this you are setting the handle back to null on the BMAX side.
extern "C" __cdecl void CTVMesh_Destroy(CTVMesh* Ha) { if (Ha) delete Ha; }
if that works, then i would look at if its possible that its being called twice. this of course assumes that in your code somewhere after calling this you are setting the handle back to null on the BMAX side.