aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-11-29 15:35:59 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-05-10 07:10:48 +0000
commitbae65d8ddb8d7b54bf5761dbd7133d3b0f65adc3 (patch)
tree50f32b205e4776a3483639525671871b0ae95829
parentbd782dea29bf925208b60dccaaa04a931e449aa1 (diff)
Make sure we cannot reload debug connectors on shutdown
The various Q_GLOBAL_STATICs involved in the loading of debug plugins may be destroyed in any order. If the connector is unloaded before the services, it might get reloaded when one service calls instance(), trying to de-register itself. Prevent this by clearing all the parameters. Change-Id: If0df8e7086e7e2a4d8701f61addd8c4a661aa349 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit fca6857529f9be982a75cd055fdc01e8d34413fb)
-rw-r--r--src/qml/debugger/qqmldebugconnector.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp
index 33bed958b5..c4c90d5c31 100644
--- a/src/qml/debugger/qqmldebugconnector.cpp
+++ b/src/qml/debugger/qqmldebugconnector.cpp
@@ -146,7 +146,10 @@ QQmlDebugConnectorFactory::~QQmlDebugConnectorFactory()
{
// This is triggered when the plugin is unloaded.
QQmlDebugConnectorParams *params = qmlDebugConnectorParams();
- if (params && params->instance) {
+ if (params) {
+ params->pluginKey.clear();
+ params->arguments.clear();
+ params->services.clear();
delete params->instance;
params->instance = 0;
}