mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-13 21:02:28 +00:00
Improve speed of process termination on exit
This commit is contained in:
parent
052194714a
commit
9a6f5ba1a8
2 changed files with 7 additions and 2 deletions
|
@ -130,8 +130,12 @@ private:
|
|||
emit computerStateChanged(m_Computer);
|
||||
}
|
||||
|
||||
// Wait a bit to poll again
|
||||
QThread::sleep(3);
|
||||
// Wait a bit to poll again, but do it in 100 ms chunks
|
||||
// so we can be interrupted reasonably quickly.
|
||||
// FIXME: QWaitCondition would be better.
|
||||
for (int i = 0; i < 30 && !isInterruptionRequested(); i++) {
|
||||
QThread::msleep(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -447,6 +447,7 @@ NvHTTP::openConnection(QUrl baseUrl,
|
|||
// Run the request with a timeout if requested
|
||||
QEventLoop loop;
|
||||
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), &loop, SLOT(quit()));
|
||||
if (timeoutMs) {
|
||||
QTimer::singleShot(timeoutMs, &loop, SLOT(quit()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue