Fix potential user-after-free when removing nodes from the graph


When removeFromGraph() orphans its direct children it must also clear
their rootNodeRef, just as removeChild() does for the removed node
itself. Without the fix, an orphaned node P retains a live
rootNodeRef. If the root is then destroyed and a grandchild C calls
removeFromGraph() it will execute P->removeChild(C), which accesses
P->rootNodeRef via QSSGRenderRoot::get() causing a use-after-free crash.

Pick-to: 6.12 6.11
Task-number: QTBUG-145409
Change-Id: I65078c4726b6af83cd5d71d36bfe249077910495
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
commite7386f76636d33776b71268bd8e05f2f39df658f
parent814708b0b5bea0a45d96c638e6095c9007f9a776
authorChristian Strømme <christian.stromme@qt.io>
committerChristian Strømme <christian.stromme@qt.io>
commit timeWed, 3 Jun 2026 09:59:11 +0000