mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-12 15:59:30 -05:00
When quitting OnionShare with services started, make sure the web services get stopped
This commit is contained in:
parent
f69cbbd389
commit
184f126189
@ -285,6 +285,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
e.accept()
|
||||
|
||||
def cleanup(self):
|
||||
self.common.log("MainWindow", "cleanup")
|
||||
self.tabs.cleanup()
|
||||
self.common.gui.onion.cleanup()
|
||||
|
||||
|
@ -663,7 +663,9 @@ class Tab(QtWidgets.QWidget):
|
||||
return False
|
||||
|
||||
def cleanup(self):
|
||||
self.common.log("Tab", "cleanup", f"tab_id={self.tab_id}")
|
||||
if self.get_mode() and self.get_mode().web_thread:
|
||||
self.get_mode().web.stop(self.get_mode().app.port)
|
||||
self.get_mode().web_thread.quit()
|
||||
self.get_mode().web_thread.wait()
|
||||
self.app.cleanup()
|
||||
|
@ -81,6 +81,8 @@ class TabWidget(QtWidgets.QTabWidget):
|
||||
self.event_handler_t.start()
|
||||
|
||||
def cleanup(self):
|
||||
self.common.log("TabWidget", "cleanup")
|
||||
|
||||
# Stop the event thread
|
||||
self.event_handler_t.should_quit = True
|
||||
self.event_handler_t.quit()
|
||||
|
Loading…
Reference in New Issue
Block a user