Function physx_sys::PxDeletionListener_onRelease_mut
source · pub unsafe extern "C" fn PxDeletionListener_onRelease_mut(
self_: *mut PxDeletionListener,
observed: *const PxBase,
userData: *mut c_void,
deletionEvent: PxDeletionEventFlag
)
Expand description
Notification if an object or its memory gets released
If release() gets called on a PxBase object, an eUSER_RELEASE event will get fired immediately. The object state can be queried in the callback but
it is not allowed to change the state. Furthermore, when reading from the object it is the user’s responsibility to make sure that no other thread
is writing at the same time to the object (this includes the simulation itself, i.e., PxScene::fetchResults
must not get called at the same time).
Calling release() on a PxBase object does not necessarily trigger its destructor immediately. For example, the object can be shared and might still be referenced by other objects or the simulation might still be running and accessing the object state. In such cases the destructor will be called as soon as it is safe to do so. After the destruction of the object and its memory, an eMEMORY_RELEASE event will get fired. In this case it is not allowed to dereference the object pointer in the callback.