releaseConvexMesh/TriangleMesh/HeightField but ReferenceCount not 0 cause crash

Hi, PhysX Devs.

Our team use T3D with PhysX to build a FPS game, we encounter an odd problem when exit game, assertion failed with “NpPhysicsSDK.cpp Line: 888, PhysicsSDK::releaseHeightField: instance of this heightfield still exist!”.

We break at the release code, found that heightField->getReferenceCount() == 1.
It seems like we add the heightfield’s ref count but not release it, but how can the ref count of heightfield be increased?

Any clues is appreciative. :)

You can put a break point in incRefCount in CmRefCountable.h to see when HF related calls increase the ref.

It might be increased during createShape, setGeometry.