diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-11-10 09:42:13 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-11-12 12:24:29 +0100 |
commit | bdbc91cb90e9858cddc23da90ddd659262faa068 (patch) | |
tree | b166c2b9df84bf99393baa5bfacf14d25c469cb0 /src/qml/jsruntime/qv4persistent.cpp | |
parent | 21237e40565c1331aab531ae2c262fdc2c96fc53 (diff) |
Fix life cycle methods of various types related to QQmlBind
Code checker complains about the absence of move ctors and operators.
While we're at it, make ctors default where possible, do not use const
rvalue refs, add noexcept where possible, properly disable moving and
copying of QQmlBindEntryContent, and inline the null check of
QV4::PersistentValueStorage::free().
Change-Id: I11b6511f39f3d84479dbacee7f3e3552a5fb2b5a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4persistent.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4persistent.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4persistent.cpp b/src/qml/jsruntime/qv4persistent.cpp index dea3019ef4..290a1d91c9 100644 --- a/src/qml/jsruntime/qv4persistent.cpp +++ b/src/qml/jsruntime/qv4persistent.cpp @@ -219,11 +219,9 @@ Value *PersistentValueStorage::allocate() return v; } -void PersistentValueStorage::free(Value *v) +void PersistentValueStorage::freeUnchecked(Value *v) { - if (!v) - return; - + Q_ASSERT(v); Page *p = getPage(v); *v = Encode(p->header.freeList); @@ -289,11 +287,6 @@ PersistentValue::PersistentValue(ExecutionEngine *engine, Object *object) *val = object; } -PersistentValue::~PersistentValue() -{ - PersistentValueStorage::free(val); -} - PersistentValue &PersistentValue::operator=(const PersistentValue &other) { if (!val) { |