From 3332dcb56b5e66dcab4f4f6d6b431864a6d9edbc Mon Sep 17 00:00:00 2001 From: mammonsama666 <1216715129@qq.com> Date: Tue, 8 Dec 2020 16:38:04 +0800 Subject: [PATCH] fix(wpa-wifi): Connection down afte activated. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 修复激活企业WIFI后自动断开的问题 Log: 修复激活企业WIFI后自动断开的问题 Bug: - --- src/wpawifidialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wpawifidialog.cpp b/src/wpawifidialog.cpp index d1f3eeda..05c7c01d 100644 --- a/src/wpawifidialog.cpp +++ b/src/wpawifidialog.cpp @@ -351,11 +351,11 @@ void WpaWifiDialog::setEditorEnable(bool is_checking) { void WpaWifiDialog::activateConnection() { UpConnThread * upThread = new UpConnThread(); upThread->conn_name = nameEditor->text(); + //超时计时器 + QTimer * timeout = new QTimer(this); connect(upThread, &UpConnThread::started, this, [ = ]() { //线程开始,开始校验密码,此时弹窗的连接按钮被禁用,所有输入框禁用 setEditorEnable(false); - //超时计时器 - QTimer * timeout = new QTimer(this); QObject::connect(timeout, &QTimer::timeout, this, [ = ](){ //连接超时 timeout->stop(); @@ -376,6 +376,8 @@ void WpaWifiDialog::activateConnection() { emit conn_failed(); } else { //连接成功 + timeout->stop(); + timeout->deleteLater(); upThread->quit(); upThread->wait(); upThread->deleteLater();