Skip to content

Commit 1a5314f

Browse files
committed
Fix exec_dialog to validate QDialog before deleting
1 parent 6511052 commit 1a5314f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/release_notes/release_3.14.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Version 3.14 #
22

3+
## guidata Version 3.14.3 ##
4+
5+
🛠️ Bug fixes:
6+
7+
* **PyQt6 compatibility**: Fixed `RuntimeError: wrapped C/C++ object has been deleted` when closing dialogs in automated tests with PyQt6 — `exec_dialog()` now checks object validity before calling `deleteLater()`, since Qt may already have destroyed the C++ object during `exec()`
8+
39
## guidata Version 3.14.2 ##
410

511
🛠️ Bug fixes:

guidata/qthelpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ def exec_dialog(dlg: QW.QDialog) -> int:
772772
)
773773
delete_later = not dlg.testAttribute(QC.Qt.WA_DeleteOnClose)
774774
result = dlg.exec()
775-
if delete_later:
775+
if delete_later and is_qobject_valid(dlg):
776776
dlg.deleteLater()
777777
return result
778778

0 commit comments

Comments
 (0)