QmlDesigner: Do not dispatch commands when already in destructor

On Linux destructing the local sockets leads to commands being
dispatched synchronously. This is not expected and totally unrequired.
When we shutdown the instance server no commands have to be dispatched
anymore.

Change-Id: Ieeca7ac2103e7b463137d76f85cd326888cc38ce
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2018-03-16 12:03:41 +01:00
parent aa75c6ebed
commit c3e19a8076
2 changed files with 6 additions and 0 deletions

View File

@@ -225,6 +225,8 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
NodeInstanceServerProxy::~NodeInstanceServerProxy() NodeInstanceServerProxy::~NodeInstanceServerProxy()
{ {
m_destructing = true;
disconnect(this, SLOT(processFinished(int,QProcess::ExitStatus))); disconnect(this, SLOT(processFinished(int,QProcess::ExitStatus)));
writeCommand(QVariant::fromValue(EndPuppetCommand())); writeCommand(QVariant::fromValue(EndPuppetCommand()));
@@ -273,6 +275,9 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr
static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand"); static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand");
static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand"); static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand");
if (m_destructing)
return;
qCInfo(instanceViewBenchmark) << "dispatching command" << command.userType() << command.typeName(); qCInfo(instanceViewBenchmark) << "dispatching command" << command.userType() << command.typeName();
if (command.userType() == informationChangedCommandType) { if (command.userType() == informationChangedCommandType) {
nodeInstanceClient()->informationChanged(command.value<InformationChangedCommand>()); nodeInstanceClient()->informationChanged(command.value<InformationChangedCommand>());

View File

@@ -128,6 +128,7 @@ private:
RunModus m_runModus; RunModus m_runModus;
int m_synchronizeId = -1; int m_synchronizeId = -1;
QTime m_benchmarkTimer; QTime m_benchmarkTimer;
bool m_destructing = false;
}; };
} // namespace QmlDesigner } // namespace QmlDesigner