Skip to content

Commit 35ec544

Browse files
committed
Fix application exit problems when having multi-test on macOS
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
1 parent cb59dc1 commit 35ec544

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Furious/Widget/Application.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ def cleanup():
292292
if PLATFORM == 'Darwin':
293293
AppThreadPool().clear()
294294

295-
APP().processEvents()
295+
for timeout in [1000, 2000, 3000]:
296+
QtCore.QTimer.singleShot(timeout, APP().exit)
296297

297298
logger.info('final cleanup done')
298299

Furious/Widget/UserServersQTableWidget.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def msgCallback(line: str):
560560
return False
561561

562562
def start(self):
563-
def _start():
563+
def startit():
564564
index = self.factory.index
565565

566566
if self.factory.deleted or index < 0 or index >= len(AS_UserServers()):
@@ -570,13 +570,13 @@ def _start():
570570
assert isinstance(self.factory, ConfigurationFactory)
571571

572572
if not self.factory.isValid():
573+
# Configuration is invalid
573574
self.factory.setExtras('speedResult', 'Invalid')
574575
self.syncProgress()
576+
else:
577+
if not self.startCore() or APP().isExiting():
578+
return
575579

576-
# Configuration is not valid. Do nothing
577-
return
578-
579-
if self.startCore():
580580
self.configureHttpProxy(f'127.0.0.1:{self.port}')
581581

582582
self.networkReply = self.webGET(NETWORK_SPEED_TEST_URL, **self.kwargs)
@@ -585,7 +585,8 @@ def _start():
585585
self.timeoutTimer.start(self.timeout)
586586

587587
try:
588-
_start()
588+
if not APP().isExiting():
589+
startit()
589590
finally:
590591
if self.networkReply is None:
591592
self.must()
@@ -1694,6 +1695,9 @@ def testDownloadSpeedByFactory(
16941695
PySide6LegacyEventLoopWait(step)
16951696

16961697
if APP().isExiting():
1698+
if not worker.isFinished():
1699+
worker.abort()
1700+
16971701
# Stop timer
16981702
self.testDownloadSpeedTimer.stop()
16991703
self.testDownloadSpeedTimerMulti.stop()

0 commit comments

Comments
 (0)