When quitting OnionShare with services started, make sure the web services get stopped

This commit is contained in:
Micah Lee 2020-11-27 12:38:00 -08:00
parent f69cbbd389
commit 184f126189
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 5 additions and 0 deletions

View File

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

View File

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

View File

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