diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-05-20 14:37:12 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-05-20 22:43:25 +0200 |
commit | a64ee3a2481499f856d0f3fbc697399e0df1e8f8 (patch) | |
tree | bd4994eb797afe3f3dca66670cf72bf0da89d590 /src/qml/qml/v8/qqmlbuiltinfunctions.cpp | |
parent | 542fdc075ebc7853869b285d6ac8fd75bfd2aafd (diff) |
Fix handling of QQuickViewPrivate::root
QQuickView is supposed to own the root item and shall also track it for
external deletion. Therefore, when we assign a new root item we need to
delete the old one. There is no point in setting a QPointer to nullptr
after deleting it. It will do that by itself. When we fail to assign a
new item, we should _not_ automatically delete the new one. Calling code
typically does not expect the argument to a set* call to be deleted
right away. Rather, return a boolean indicating whether we have
successfully set the root object. This can then be used to get rid of
the object if necessary.
Coverity-Id: 218729
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I79ed37d22d304bcc6d4e3c956b83a65fe157dfe0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/qml/v8/qqmlbuiltinfunctions.cpp')
0 files changed, 0 insertions, 0 deletions