Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bec_widgets/utils/bec_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def closeEvent(self, event):
"""Wrap the close even to ensure the rpc_register is cleaned up."""
try:
if not self._destroyed:
self.cleanup()
self._destroyed = True
self.cleanup()
finally:
super().closeEvent(event) # pylint: disable=no-member
10 changes: 10 additions & 0 deletions bec_widgets/widgets/containers/dock_area/basic_dock_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,16 @@ def delete_all(self):
for dock in self.dock_list():
self._delete_dock(dock)

def cleanup(self):
"""Tear down all docks via the Qt ADS API before the base BECWidget cleanup runs.

Explicitly releasing dock widgets through the CDockManager API first prevents crashes
in PySide6 6.11.0 / PySide6-QtAds 4.5.x where the CDockManager destructor interacts
badly with dock widgets that are deleted outside of it.
"""
self.delete_all()
super().cleanup()


if __name__ == "__main__": # pragma: no cover
import sys
Expand Down
7 changes: 6 additions & 1 deletion bec_widgets/widgets/editors/bec_console/bec_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ def _parking_parent(
return None

window = console.window()
if window is not None and window is not console and self._is_valid_qobject(window):
if (
window is not None
and window is not console
and self._is_valid_qobject(window)
and not getattr(window, "_destroyed", False)
):
return window

if not avoid_console:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ classifiers = [
]
dependencies = [
"PyJWT~=2.9",
"PySide6==6.9.0",
"PySide6-QtAds==4.4.0",
"PySide6==6.11.0",
"PySide6-QtAds==4.5.0.4",
"bec_ipython_client~=3.107,>=3.107.2", # needed for jupyter console
"bec_lib~=3.107,>=3.107.2",
"bec_qthemes~=1.0, >=1.3.4",
Expand Down
Loading