diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-10 19:52:49 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-11 08:56:29 +0200 |
commit | 55d94de05881927d3e98cd58da6a9d4cdffad790 (patch) | |
tree | 85fc4af390529e4b95db6298268c5b2cf6a4cfcd /src/qml/qml | |
parent | 40db24351b6a89a3fb30a4870afdf90a4b91663f (diff) |
Protect a few constructors against self destruction
This gets most of qqmlecmascript to pass with aggressive and
exact garbage collection.
Change-Id: I93ecbfe55f62af68227cdf3b1ec2bd066f1cbdef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index ba5f05b5ba..f9aca08d5a 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -93,6 +93,7 @@ QV4::QtObject::QtObject(ExecutionEngine *v4, QQmlEngine *qmlEngine) vtbl = &static_vtbl; Scope scope(v4); + ScopedObject protectThis(scope, this); // Set all the enums from the "Qt" namespace const QMetaObject *qtMetaObject = StaticQtMetaObject::get(); @@ -1313,6 +1314,9 @@ ReturnedValue QtObject::method_get_inputMethod(SimpleCallContext *ctx) QV4::ConsoleObject::ConsoleObject(ExecutionEngine *v4) : Object(v4) { + QV4::Scope scope(v4); + QV4::ScopedObject protectThis(scope, this); + defineDefaultProperty(QStringLiteral("debug"), method_log); defineDefaultProperty(QStringLiteral("log"), method_log); defineDefaultProperty(QStringLiteral("info"), method_log); |