diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-11-02 14:28:02 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-04 11:27:52 +0100 |
commit | f9261feb16d02e985982dd46783ea54c2cfce91b (patch) | |
tree | 205743bcd164628f882aa35580fd136384a28acb /src/declarative/qml/v8/qv8contextwrapper.cpp | |
parent | 0dd867535bebf6db673d4f03959e62e94ff35ba2 (diff) |
Skip the captured properties step in bindings
Objects and notifiers in the capturedProperties list were not guarded
which can lead to crashes if they're deleted prior to the binding
completing. Now the notifiers are connected to and guarded immediately
to prevent this.
Change-Id: I912e323c52bf6169fb5077e552d5d38d9aa7faec
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qv8contextwrapper.cpp')
-rw-r--r-- | src/declarative/qml/v8/qv8contextwrapper.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/declarative/qml/v8/qv8contextwrapper.cpp b/src/declarative/qml/v8/qv8contextwrapper.cpp index 29857b2585..46cf0e4298 100644 --- a/src/declarative/qml/v8/qv8contextwrapper.cpp +++ b/src/declarative/qml/v8/qv8contextwrapper.cpp @@ -317,21 +317,17 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property, int propertyIdx = context->propertyNames->value(propertystring); if (propertyIdx != -1) { - typedef QDeclarativeEnginePrivate::CapturedProperty CapturedProperty; if (propertyIdx < context->idValueCount) { - if (ep->captureProperties) - ep->capturedProperties << CapturedProperty(&context->idValues[propertyIdx].bindings); - + ep->captureProperty(&context->idValues[propertyIdx].bindings); return engine->newQObject(context->idValues[propertyIdx]); } else { QDeclarativeContextPrivate *cp = context->asQDeclarativeContextPrivate(); - if (ep->captureProperties) - ep->capturedProperties << CapturedProperty(context->asQDeclarativeContext(), -1, - propertyIdx + cp->notifyIndex); + ep->captureProperty(context->asQDeclarativeContext(), -1, + propertyIdx + cp->notifyIndex); const QVariant &value = cp->propertyValues.at(propertyIdx); if (value.userType() == qMetaTypeId<QList<QObject*> >()) { |