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>
This commit is contained in:
parent
07d714f3ca
commit
645d9e9632
|
@ -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))
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue