Don't ask aspects to destroy nodes that never had a backend node
getNodesForRemoval() queued a Removed change for every node of the subtree,
including nodes still waiting for post-constructor init. Those have a null
m_typeInfo, so clearBackendNode() asserted in mapperForNode() on the next
frame.
m_hasBackendNode is only ever set together with m_typeInfo, so use it to
skip those nodes.
Add a regression test covering this and the use-after-free fixed in the
previous commit, as both come from the same scenario: a node destroyed,
along with its parent, before the event loop spins.
Pick-to: 6.12 6.11 6.8
Change-Id: I8435cd67de5c2fda7522a2cd49e155fb25fb7a7c
Reviewed-by: Mauro Persano <mauro.persano@kdab.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>