diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-11-03 07:26:36 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-11-11 16:44:11 +0100 |
| commit | e46378eb6eec85f4ea454778744c13a6e598107d (patch) | |
| tree | d8aa6a71adc0503fe37c3aceb0137106c73f51f3 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 341d0ae496fb97237e03a1e9ab06d5c502a87654 (diff) | |
QmlModels: Clarify ownership of submodels stored in QVariant
Holding them in a local pointer makes it look like they leak. In actual
fact they are "owned" by the QVariant and assigned to a property later.
Also, check for model earlier. Apparently it can be nullptr if we're
dealing with a translation binding. In that case we don't hit the code
path that evaluates script bindings and therefore won't crash or leak.
However, the return statement after creating the QVariant is confusing
when trying to understand the ownership structure.
Coverity-Id: 897095
Coverity-Id: 897097
Change-Id: I770632d7e8aba7803ffe36363a6f9665873e3e61
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
0 files changed, 0 insertions, 0 deletions
