aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v4/qv4compiler.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-11-02 14:28:02 +0000
committerQt by Nokia <qt-info@nokia.com>2011-11-04 11:27:52 +0100
commitf9261feb16d02e985982dd46783ea54c2cfce91b (patch)
tree205743bcd164628f882aa35580fd136384a28acb /src/declarative/qml/v4/qv4compiler.cpp
parent0dd867535bebf6db673d4f03959e62e94ff35ba2 (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/v4/qv4compiler.cpp')
-rw-r--r--src/declarative/qml/v4/qv4compiler.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/qml/v4/qv4compiler.cpp b/src/declarative/qml/v4/qv4compiler.cpp
index a9d2338307..857bceb460 100644
--- a/src/declarative/qml/v4/qv4compiler.cpp
+++ b/src/declarative/qml/v4/qv4compiler.cpp
@@ -59,6 +59,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlVerboseCompiler, QML_VERBOSE_COMPILER)
DEFINE_BOOL_CONFIG_OPTION(qmlBindingsTestEnv, QML_BINDINGS_TEST)
static bool qmlBindingsTest = false;
+static bool qmlEnableV4 = true;
using namespace QDeclarativeJS;
QV4CompilerPrivate::QV4CompilerPrivate()
@@ -1219,7 +1220,7 @@ int QV4Compiler::compile(const Expression &expression, QDeclarativeEnginePrivate
if (!qmlExperimental() && expression.property->isValueTypeSubProperty)
return -1;
- if (qmlDisableOptimizer())
+ if (qmlDisableOptimizer() || !qmlEnableV4)
return -1;
d->expression = &expression;
@@ -1341,4 +1342,9 @@ void QV4Compiler::enableBindingsTest(bool e)
qmlBindingsTest = qmlBindingsTestEnv();
}
+void QV4Compiler::enableV4(bool e)
+{
+ qmlEnableV4 = e;
+}
+
QT_END_NAMESPACE