The crash can be reproduced with attached program, which creates and deletes a sphere in a timer loop. The material is owned by the sphere entity, so it also gets deleted. The attached application needs to be in examples folder of qt3d to work, as it is a modified example.
The end cause for the crash is the null RenderStateNodes inside the collection parameter given to addToRenderStateSet(). RenderStateCollection::removeRenderState() is never called for destroyed materials, so the states for deleted nodes are retained.
Qt3D SHA: faf56f50608f9391d2a73ed7c61bfdd9c2afab78
Same crash can be also seen in scene editor e.g. when resetting the scene (File/New). Scene editor SHA: 8342887bba58cf3e43d70441ba5435c3a76e9aca
The call stack:
|For Gerrit Dashboard: QTBUG-53308|
|160058,2||Remove deleted entries from RenderStateCollection cache||5.7.0||qt/qt3d||Status: MERGED||+2||0|