diff options
author | Luca Di Sera <luca.disera@qt.io> | 2024-05-30 12:24:05 +0200 |
---|---|---|
committer | Luca Di Sera <luca.disera@qt.io> | 2024-06-06 20:16:14 +0200 |
commit | 1e84143756e8b36e740c59c3b056693546a89ea5 (patch) | |
tree | 2ba674789e959962beb2c490667b7f811572fa98 /tests/auto/qml/qmllint/data/missingComponentBehaviorBound.qml | |
parent | ce95fae56831fe7858173a9994aa78145e9e6845 (diff) |
Generally, we should avoid having unscoped values lying around as they
could be collected by the GC.
A pattern in `qqmlglobal.cpp` makes a direct cast to `QV4::value` that
is safe due to the value being tied to a `QJSValue`.
Add a comment to the two usages of the pattern to identify that using a
naked `Value` might not always be safe.
The added comment is intended to make the general issue with `Value`s
more apparent to people with less experience working with the code-base,
make the reason the usage is safe in this case more explicit for people
who have cursory knowledge of the possible issue and, possibly, help
thinking in more correct terms when similar patterns are written in
other parts of the code-base.
Change-Id: Ie2614079aaad896eb86d9491cdf0f2d61c321e75
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint/data/missingComponentBehaviorBound.qml')
0 files changed, 0 insertions, 0 deletions