fixbug QTTimeer

This commit is contained in:
Macbook 2024-12-24 23:05:27 +07:00
parent 6331658a76
commit c9003f537d

View file

@ -874,6 +874,12 @@ void IosController::requestInetAccess() {
void IosController::stopForHandshake() { void IosController::stopForHandshake() {
if (m_handshakeTimer) { if (m_handshakeTimer) {
if (QThread::currentThread() != m_handshakeTimer->thread()) {
QMetaObject::invokeMethod(m_handshakeTimer, "stop", Qt::QueuedConnection);
QMetaObject::invokeMethod(m_handshakeTimer, "deleteLater", Qt::QueuedConnection);
m_handshakeTimer = nullptr;
return;
}
if (m_handshakeTimer->isActive()) { if (m_handshakeTimer->isActive()) {
m_handshakeTimer->stop(); m_handshakeTimer->stop();
} }