mirror of
https://github.com/onionshare/onionshare.git
synced 2025-04-21 07:56:32 -04:00
Prevent recursion on the MainWindow.cleanup() call by setting an in-progress attribute
This commit is contained in:
parent
4fbe981c31
commit
2b6f3cfbe3
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user