0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 11:11:49 +02:00

fix(main_window): central widget cleanup check to not remove None

This commit is contained in:
2025-06-13 16:35:16 +02:00
committed by Jan Wyzula
parent d07265b86d
commit 644be621f2

View File

@ -175,8 +175,9 @@ class BECMainWindow(BECWidget, QMainWindow):
def cleanup(self): def cleanup(self):
central_widget = self.centralWidget() central_widget = self.centralWidget()
central_widget.close() if central_widget is not None:
central_widget.deleteLater() central_widget.close()
central_widget.deleteLater()
if not isinstance(central_widget, BECWidget): if not isinstance(central_widget, BECWidget):
# if the central widget is not a BECWidget, we need to call the cleanup method # if the central widget is not a BECWidget, we need to call the cleanup method
# of all widgets whose parent is the current BECMainWindow # of all widgets whose parent is the current BECMainWindow