Guard character-controller hit callback against same-frame node removal
ControllerCallback::onShapeHit() only null-checked the userData-derived
pointers before emitting shapeHit(), unlike the sibling
SimulationEventCallback::onTrigger()/onContact() callbacks, which also
check isNodeRemoved() to guard against a node being deregistered (and
possibly mid-destruction) in the same simulation frame -- the exact
race QTBUG-110258 was fixed for on the trigger path. Add the same guard
here.
Adds a stress test that repeatedly spawns/destroys both the character
(the "trigger" side of the hit report) and the obstacle it lands on
(the "other" side) with enableShapeHitCallback: true, to exercise both
halves of the guard. Honesty note: running this 5x against the pre-fix
code did not reproduce a crash -- QML's Object.destroy() defers actual
C++ deletion via deleteLater(), which likely narrows the exact timing
window this guards against compared to however QTBUG-110258's original
crash was produced. Kept as a stress/smoke test, not a proven repro.
Pick-to: 6.12 6.11 6.8
Change-Id: I360d7156eba475e48b4830af8e632bce36c88c6f
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>