diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-01 16:33:04 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-01 21:36:36 +0100 |
commit | 645d9e9632e061b26b2312d144a26fe8dc75cd1c (patch) | |
tree | ae63035ef7f5b1bab8cf47add75d4ebbbdd44e30 /src/qml/jsapi | |
parent | 07d714f3ca5c736f69d5a8eb3cf4d656aa348c82 (diff) |
Fix constructions of QJSEngine objects
The private class is not empty anymore, so calling the wrong
constructor would lead to memory corruption
Change-Id: I6d477fc63bba46be733273f548397c2a50ef2bf4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r-- | src/qml/jsapi/qjsengine.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index 04ed341a50..09891019c5 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -165,7 +165,8 @@ QT_BEGIN_NAMESPACE \l{ECMA-262}, Section 15.1. */ QJSEngine::QJSEngine() - : d(new QV8Engine(this)) + : QObject(*new QJSEnginePrivate, 0) + , d(new QV8Engine(this)) { } @@ -177,7 +178,7 @@ QJSEngine::QJSEngine() */ QJSEngine::QJSEngine(QObject *parent) - : QObject(parent) + : QObject(*new QJSEnginePrivate, parent) , d(new QV8Engine(this)) { } |