@@ -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