LoadSceneJob: don't risk to leak the loaded subtree


There is a risk that the front-end QSceneLoader node has been destroyed
by the time the LoadSceneJob completes. The postFrame() would then do
nothing, and the m_sceneSubtree pointer will be forgotten, leaking the
whole tree. This can happen in real life when loading very large scenes.

To ensure that we cannot leak the scene tree, use strict pointer
ownership with std::unique_ptr.

Pick-to: 6.4 6.5
Change-Id: Ie2281bc178fc8793bab967a13ea8d30aa46268a0
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
commitbe8b6796c17cd1a616975bbd24f7a0cead725a48
parentbffdaabaa5cd9d7fdc64e4124817b504319708e1
authorAurélien Brooke <aurelien@bahiasoft.fr>
committerAurélien Brooke <aurelien@bahiasoft.fr>
commit timeSat, 17 Dec 2022 08:15:03 +0100