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,11 +244,9 @@ Client::Client(const Utils::FilePath &remoteCmdBridgePath)
|
|||||||
|
|
||||||
Client::~Client()
|
Client::~Client()
|
||||||
{
|
{
|
||||||
if (d->thread->isRunning()) {
|
if (d->thread->isRunning() && exit())
|
||||||
exit();
|
|
||||||
d->thread->wait();
|
d->thread->wait();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
expected_str<QFuture<Environment>> Client::start()
|
expected_str<QFuture<Environment>> Client::start()
|
||||||
{
|
{
|
||||||
@@ -856,12 +854,14 @@ Utils::expected_str<QFuture<void>> Client::signalProcess(int pid, Utils::Control
|
|||||||
"signalsuccess");
|
"signalsuccess");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::exit()
|
bool Client::exit()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
createVoidJob(d.get(), QCborMap{{"Type", "exit"}}, "exitres")->waitForFinished();
|
createVoidJob(d.get(), QCborMap{{"Type", "exit"}}, "exitres")->waitForFinished();
|
||||||
|
return true;
|
||||||
} catch (...) {
|
} 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);
|
Utils::expected_str<QFuture<void>> signalProcess(int pid, Utils::ControlSignal signal);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void exit();
|
bool exit();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void done(const Utils::ProcessResultData &resultData);
|
void done(const Utils::ProcessResultData &resultData);
|
||||||
|
Reference in New Issue
Block a user