Speed up QSvgStructureNode::releaseDescendants()


The previous implementation traversed the tree of objects until it found
something it may delete. Then it deleted that and started from the root
of the tree again to find the next object.

Instead, this code traverses the tree only once and deletes what it
finds on the way.

Amends 22d503993d156d89086f1a68c76670cbc7130be0

Task-number: QTBUG-145916
Pick-to: 6.11 6.10 6.8
Change-Id: If693f62ea469d85536eed0fcf7a87103c335c68c
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
commit32680b86192ea67d9e273061108439166e7db3d6
parent8b15b5155cbc64ed427326cb3b7f9fb4d6c59531
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeThu, 28 May 2026 10:26:46 +0000