Skip to content

Commit 691dad0

Browse files
committed
修复登录多次点击的线程错误
1 parent 5fe8ddf commit 691dad0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.settings/org.eclipse.core.resources.prefs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ encoding//Widgets/Dialogs/SkinDialog.py=utf-8
6060
encoding//Widgets/Dialogs/TwinkleDialog.py=utf-8
6161
encoding//Widgets/Dialogs/UpdateDialog.py=utf-8
6262
encoding//Widgets/FramelessWindow.py=utf-8
63-
encoding//Widgets/MainWindow.py=utf-8
6463
encoding//Widgets/MainWindowBase.py=utf-8
6564
encoding//Widgets/Skins/ColourfulWidget.py=utf-8
6665
encoding//Widgets/Skins/PictureWidget.py=utf-8

Utils/GitThread.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ def start(cls, account, password, parent=None):
5454
:param account: 账号
5555
:param password: 密码
5656
"""
57+
if hasattr(cls, '_thread'):
58+
cls._thread.quit()
59+
cls._thread.wait(1000)
60+
cls._thread.deleteLater()
61+
AppLog.info('login thread killed')
5762
cls._thread = QThread(parent)
5863
cls._worker = LoginThread(account, password)
5964
cls._worker.moveToThread(cls._thread)

0 commit comments

Comments
 (0)