diff options
Diffstat (limited to 'src/qml/debugger/qqmldebugconnector.cpp')
-rw-r--r-- | src/qml/debugger/qqmldebugconnector.cpp | 14 |
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 |