Closed MrCsabaToth closed 3 years ago
Upon investigation the faulty code was the jBulletController.updateCylinderLocation
inside the onTransformChanged
. The onTransformChanged
is the callback for Sceneform's TransformableNode
(the way we handle this is that MainActivity extends AppCompatActivity implements Node.TransformChangedListener
and we attach a listener manually cylinderNode.addTransformChangedListener(this);
.
The safety check checks on cylinderNode != null
but it seems that during Scene clear operation we must manually null the cylinderNode
which we keep a pointer to ourselves. This tricked the safety checks. The Scene was mostly clear, but an unwanted cylinder node still kept alive (possibly due to our action of holding a strong pointer at it). The updates kept coming but we destroyed the Physics engine. I'm adding more safety checks and making sure taking care of the cylinderNode
pointer. As an extra I call clearSceve from the onDestroy
as well. I'm also making sure we detach the listener before I null out the node.
Reported by the Play Store. Interesting that the app was not installed from the Play Store but from some other channels, it came from a Samsung Galaxy A70 and ZTE Z717VL (Android 9 - API 28 and Android 10 API 29) devices. https://play.google.com/console/u/0/developers/7696534728259995393/app/4974857956571804228/vitals/crashes/d415f426/details?days=30
Call stack: