forked from qt-creator/qt-creator
CmdBridge: Act on exceptions in Client::exit()
Change-Id: I93b82d2e559366b67e7a9069fd3ff371d37988ad Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -244,10 +244,8 @@ Client::Client(const Utils::FilePath &remoteCmdBridgePath)
|
||||
|
||||
Client::~Client()
|
||||
{
|
||||
if (d->thread->isRunning()) {
|
||||
exit();
|
||||
if (d->thread->isRunning() && exit())
|
||||
d->thread->wait();
|
||||
}
|
||||
}
|
||||
|
||||
expected_str<QFuture<Environment>> Client::start()
|
||||
@@ -856,12 +854,14 @@ Utils::expected_str<QFuture<void>> Client::signalProcess(int pid, Utils::Control
|
||||
"signalsuccess");
|
||||
}
|
||||
|
||||
void Client::exit()
|
||||
bool Client::exit()
|
||||
{
|
||||
try {
|
||||
createVoidJob(d.get(), QCborMap{{"Type", "exit"}}, "exitres")->waitForFinished();
|
||||
return true;
|
||||
} catch (...) {
|
||||
return;
|
||||
qCWarning(clientLog) << "Client::exit() caught exception";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -113,7 +113,7 @@ public:
|
||||
Utils::expected_str<QFuture<void>> signalProcess(int pid, Utils::ControlSignal signal);
|
||||
|
||||
protected:
|
||||
void exit();
|
||||
bool exit();
|
||||
|
||||
signals:
|
||||
void done(const Utils::ProcessResultData &resultData);
|
||||
|
Reference in New Issue
Block a user