diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-08-04 14:19:26 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-11 10:35:35 +0200 |
commit | 89b694ea15e46461aef5e1695e820582152c67c5 (patch) | |
tree | d94adedcc28c7562ffb1a95989aa6b22b1d376e5 /src/declarative/qml/v8/qjsvalue_impl_p.h | |
parent | 038619bf2c5e7d2c18a6f463cd994d8b3831e61f (diff) |
Replace QScriptBagContainer by QIntrusiveList
QIntrusiveList effectively does the same as
QScriptBagContainer, without the need to inherit a
Node class. Let's avoid the code duplication.
However, QIntrusiveList::remove() and insert()
are less strict than QScriptBagContainer; introduce
QScriptIntrusiveList that performs the same sanity
checks (no duplicate insertion, etc). Ideally these
checks would be merged into QIntrusiveList.
Also rename QJSValuePrivate::reinitialize() to
invalidate(), and make it not call
engine->unregisterValue(this) any more. Values are
only invalidated at engine destruction time, and
it's the engine's responsibility to erase the list.
Change-Id: I60fc61ee8f90a716a285b1dd1bf4d6a08a9349df
Reviewed-on: http://codereview.qt.nokia.com/2628
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qjsvalue_impl_p.h')
-rw-r--r-- | src/declarative/qml/v8/qjsvalue_impl_p.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/qml/v8/qjsvalue_impl_p.h b/src/declarative/qml/v8/qjsvalue_impl_p.h index 39bfd898ee..b0ad7669d7 100644 --- a/src/declarative/qml/v8/qjsvalue_impl_p.h +++ b/src/declarative/qml/v8/qjsvalue_impl_p.h @@ -1038,12 +1038,14 @@ bool QJSValuePrivate::assignEngine(QV8Engine* engine) /*! \internal - reinitialize this value to an invalid value. + Invalidates this value. + + Does not remove the value from the engine's list of + registered values; that's the responsibility of the caller. */ -void QJSValuePrivate::reinitialize() +void QJSValuePrivate::invalidate() { if (isJSBased()) { - m_engine->unregisterValue(this); m_value.Dispose(); m_value.Clear(); } else if (isStringBased()) { |