aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/debugger/qqmldebugconnector.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-07-14 18:35:02 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-04 13:34:39 +0000
commitf0fdb1ce982c6cf594379c92fd45d745805d4b4c (patch)
tree37b0dc01b23739142953e042a9778f521c445c9c /src/qml/debugger/qqmldebugconnector.cpp
parente7a709044e75004075e62c1c3a665b19c47947af (diff)
Move QQmlDebugServer into a plugin
Change-Id: I8dc95f64c6df7303e8f580f191ee35da2284718b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/debugger/qqmldebugconnector.cpp')
-rw-r--r--src/qml/debugger/qqmldebugconnector.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp
index b31e61749b..b14ada6a62 100644
--- a/src/qml/debugger/qqmldebugconnector.cpp
+++ b/src/qml/debugger/qqmldebugconnector.cpp
@@ -49,7 +49,9 @@
QT_BEGIN_NAMESPACE
-extern QQmlDebugConnector *loadQQmlDebugConnector(const QString &key);
+// We could add more plugins here, and distinguish by arguments to instance()
+Q_QML_DEBUG_PLUGIN_LOADER(QQmlDebugConnector)
+Q_QML_IMPORT_DEBUG_PLUGIN(QQmlDebugServerFactory)
struct QQmlDebugConnectorParams {
QString pluginKey;
@@ -125,4 +127,14 @@ QQmlDebugConnector *QQmlDebugConnector::instance()
return params->instance;
}
+QQmlDebugConnectorFactory::~QQmlDebugConnectorFactory()
+{
+ // This is triggered when the plugin is unloaded.
+ QQmlDebugConnectorParams *params = qmlDebugConnectorParams();
+ if (params && params->instance) {
+ delete params->instance;
+ params->instance = 0;
+ }
+}
+
QT_END_NAMESPACE