aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-11-30 20:05:43 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-12-15 17:53:25 +0000
commit57f7fe3e1c92d11bb9e3bf2c87a11e4bc740e255 (patch)
tree1ea2225a00b8d591c58e59a5f530af3bcb55c8d7 /src/qml/qml/qqmlengine.cpp
parent63dede74a386012f9bd5a6896c3fd6ef6ffa01cd (diff)
Support debugging and profiling for pure QJSEngines
The engines will register themselves with the debug server whenever they are created without a private object. The assumption is that we get the latest possible registration like this. They try to deregister in all dtors, but they check if a different engine has done the same first. Change-Id: Ife7d7532d1de2e4a6ee21d9f7e673fcdfff2387b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r--src/qml/qml/qqmlengine.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 2d3d8aa03c..b3636d1fa6 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -868,11 +868,6 @@ void QQmlEnginePrivate::init()
v8engine()->setEngine(q);
rootContext = new QQmlContext(q,true);
-
- if (QCoreApplication::instance()->thread() == q->thread() && QQmlDebugConnector::instance()) {
- QQmlDebugConnector::instance()->open();
- QQmlDebugConnector::instance()->addEngine(q);
- }
}
QQuickWorkerScriptEngine *QQmlEnginePrivate::getWorkerScriptEngine()
@@ -924,6 +919,7 @@ QQmlEngine::QQmlEngine(QObject *parent)
{
Q_D(QQmlEngine);
d->init();
+ QJSEnginePrivate::addToDebugServer(this);
}
/*!
@@ -948,9 +944,7 @@ QQmlEngine::QQmlEngine(QQmlEnginePrivate &dd, QObject *parent)
QQmlEngine::~QQmlEngine()
{
Q_D(QQmlEngine);
- QQmlDebugConnector *server = QQmlDebugConnector::instance();
- if (server)
- server->removeEngine(this);
+ QJSEnginePrivate::removeFromDebugServer(this);
d->typeLoader.invalidate();