diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-03-17 17:09:10 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-19 20:00:17 +0000 |
commit | 4ae76406515cb61b56f7a8c97529ce65bf21952b (patch) | |
tree | cd887eb1fd2c86f1eb6b08a1d32ccb37c9eb5f51 /src/quick/items/qquickwindow.cpp | |
parent | cb0276a4c1ed304103ccf59ff1c3ad1f502f396f (diff) |
Use unique_ptr to clarify ownership of QQuickDefaultClipNode objects
The clang static analyzer warns in 3df1fff15a10a64372ed4f92ba05271f about
a potential memory leak. While that particular claim is a false positive
(the loop is always entered if sortedIndex is not empty), the re-use of
the currentClipNode variable makes it hard to follow the object ownership,
and there might still be a potential memory leak.
Use std::unique_ptr to force explicit transfer of ownership, and get
implicit destruction of objects not owned at the end of the scope.
Change-Id: If826e1d81b92f1da60aae2262b628dcaaa2e592a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 02c6e7bc3aca42a188b772aa9794b919e60017e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
0 files changed, 0 insertions, 0 deletions