Skip to content

Commit 5685b8d

Browse files
Clean up Qt socket notifier to avoid spurious interrupt handler calls
Closes #29688 Objects without a parent are not necessarily cleaned up in PyQt when their reference count reaches zero, and must be explicitly cleaned up with `deleteLater()` This prevents the notifier firing after the signal handling was supposed to have been reset to its previous state.
1 parent 9340190 commit 5685b8d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,7 @@ def save_args_and_handle_sigint(*args):
16551655
finally:
16561656
wsock.close()
16571657
rsock.close()
1658+
notifier.deleteLater()
16581659
signal.set_wakeup_fd(old_wakeup_fd)
16591660
signal.signal(signal.SIGINT, old_sigint_handler)
16601661
if handler_args is not None:

0 commit comments

Comments
 (0)