From bb105209e8bc34a63e2e04bc8de42a603f3368d4 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 22 Feb 2022 15:28:05 +0100 Subject: [PATCH] Revert storing of messagebox - This is NOT done because the original crash was reproducible - but just out of pure legacy reasons for if the error might still occur. It would be worth looking into whether the crash can still be reproduced in recent Blender versions without this logic. --- openpype/tools/workfiles/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openpype/tools/workfiles/app.py b/openpype/tools/workfiles/app.py index 27ffb768a3..3a772a038c 100644 --- a/openpype/tools/workfiles/app.py +++ b/openpype/tools/workfiles/app.py @@ -544,6 +544,10 @@ class FilesWidget(QtWidgets.QWidget): # file on a refresh of the files model. self.auto_select_latest_modified = True + # Avoid crash in Blender and store the message box + # (setting parent doesn't work as it hides the message box) + self._messagebox = None + files_view = FilesView(self) # Create the Files model @@ -722,7 +726,7 @@ class FilesWidget(QtWidgets.QWidget): self.file_opened.emit() def save_changes_prompt(self): - messagebox = QtWidgets.QMessageBox(parent=self) + self._messagebox = messagebox = QtWidgets.QMessageBox(parent=self) messagebox.setWindowFlags(messagebox.windowFlags() | QtCore.Qt.FramelessWindowHint) messagebox.setIcon(messagebox.Warning)