|
@@ -3598,14 +3598,13 @@ class App(QtCore.QObject):
|
|
|
|
|
|
|
|
# try to quit the Socket opened by ArgsThread class
|
|
# try to quit the Socket opened by ArgsThread class
|
|
|
try:
|
|
try:
|
|
|
- self.new_launch.thread_exit = True
|
|
|
|
|
- self.new_launch.listener.close()
|
|
|
|
|
|
|
+ self.new_launch.stop.emit()
|
|
|
except Exception as err:
|
|
except Exception as err:
|
|
|
log.debug("App.quit_application() --> %s" % str(err))
|
|
log.debug("App.quit_application() --> %s" % str(err))
|
|
|
|
|
|
|
|
# try to quit the QThread that run ArgsThread class
|
|
# try to quit the QThread that run ArgsThread class
|
|
|
try:
|
|
try:
|
|
|
- self.th.terminate()
|
|
|
|
|
|
|
+ self.th.quit()
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
log.debug("App.quit_application() --> %s" % str(e))
|
|
log.debug("App.quit_application() --> %s" % str(e))
|
|
|
|
|
|
|
@@ -3615,7 +3614,6 @@ class App(QtCore.QObject):
|
|
|
# quit app by signalling for self.kill_app() method
|
|
# quit app by signalling for self.kill_app() method
|
|
|
# self.close_app_signal.emit()
|
|
# self.close_app_signal.emit()
|
|
|
QtWidgets.qApp.quit()
|
|
QtWidgets.qApp.quit()
|
|
|
- # QtCore.QCoreApplication.exit()
|
|
|
|
|
|
|
|
|
|
# When the main event loop is not started yet in which case the qApp.quit() will do nothing
|
|
# When the main event loop is not started yet in which case the qApp.quit() will do nothing
|
|
|
# we use the following command
|
|
# we use the following command
|
|
@@ -3627,7 +3625,6 @@ class App(QtCore.QObject):
|
|
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
|
def kill_app():
|
|
def kill_app():
|
|
|
- # QtCore.QCoreApplication.quit()
|
|
|
|
|
QtWidgets.qApp.quit()
|
|
QtWidgets.qApp.quit()
|
|
|
# When the main event loop is not started yet in which case the qApp.quit() will do nothing
|
|
# When the main event loop is not started yet in which case the qApp.quit() will do nothing
|
|
|
# we use the following command
|
|
# we use the following command
|
|
@@ -10888,6 +10885,7 @@ class App(QtCore.QObject):
|
|
|
class ArgsThread(QtCore.QObject):
|
|
class ArgsThread(QtCore.QObject):
|
|
|
open_signal = pyqtSignal(list)
|
|
open_signal = pyqtSignal(list)
|
|
|
start = pyqtSignal()
|
|
start = pyqtSignal()
|
|
|
|
|
+ stop = pyqtSignal()
|
|
|
|
|
|
|
|
if sys.platform == 'win32':
|
|
if sys.platform == 'win32':
|
|
|
address = (r'\\.\pipe\NPtest', 'AF_PIPE')
|
|
address = (r'\\.\pipe\NPtest', 'AF_PIPE')
|
|
@@ -10900,6 +10898,7 @@ class ArgsThread(QtCore.QObject):
|
|
|
self.thread_exit = False
|
|
self.thread_exit = False
|
|
|
|
|
|
|
|
self.start.connect(self.run)
|
|
self.start.connect(self.run)
|
|
|
|
|
+ self.stop.connect(self.close_listener)
|
|
|
|
|
|
|
|
def my_loop(self, address):
|
|
def my_loop(self, address):
|
|
|
try:
|
|
try:
|
|
@@ -10943,4 +10942,9 @@ class ArgsThread(QtCore.QObject):
|
|
|
def run(self):
|
|
def run(self):
|
|
|
self.my_loop(self.address)
|
|
self.my_loop(self.address)
|
|
|
|
|
|
|
|
|
|
+ @pyqtSlot()
|
|
|
|
|
+ def close_listener(self):
|
|
|
|
|
+ self.thread_exit = True
|
|
|
|
|
+ self.listener.close()
|
|
|
|
|
+
|
|
|
# end of file
|
|
# end of file
|