diff --git a/desktop/onionshare/main_window.py b/desktop/onionshare/main_window.py index 986f8720..416eb194 100644 --- a/desktop/onionshare/main_window.py +++ b/desktop/onionshare/main_window.py @@ -284,6 +284,10 @@ class MainWindow(QtWidgets.QMainWindow): Alert(self.common, notice, QtWidgets.QMessageBox.Information) def cleanup(self): + if hasattr(self, "_cleanup_in_progress") and self._cleanup_in_progress: + return + self._cleanup_in_progress = True + self.common.log("MainWindow", "cleanup") self.tabs.cleanup() @@ -314,6 +318,8 @@ class MainWindow(QtWidgets.QMainWindow): # Wait 1 second for threads to close gracefully, so tests finally pass time.sleep(1) + self._cleanup_in_progress = False + def resizeEvent(self, event: QtGui.QResizeEvent): self.window_resized.emit() return super(MainWindow, self).resizeEvent(event)