diff --git a/desktop/src/onionshare/main_window.py b/desktop/src/onionshare/main_window.py index c1e0cd1a..5a099cbc 100644 --- a/desktop/src/onionshare/main_window.py +++ b/desktop/src/onionshare/main_window.py @@ -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() diff --git a/desktop/src/onionshare/tab/tab.py b/desktop/src/onionshare/tab/tab.py index 5e819405..f474b9ba 100644 --- a/desktop/src/onionshare/tab/tab.py +++ b/desktop/src/onionshare/tab/tab.py @@ -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() diff --git a/desktop/src/onionshare/tab_widget.py b/desktop/src/onionshare/tab_widget.py index 84d16e83..b78e67dd 100644 --- a/desktop/src/onionshare/tab_widget.py +++ b/desktop/src/onionshare/tab_widget.py @@ -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()