@@ -342,7 +342,9 @@ def __init__(self, app=None, set_running_loop=False, already_running=False):
342342
343343 self .__call_soon_signaller = signaller = _make_signaller (QtCore , object , tuple )
344344 self .__call_soon_signal = signaller .signal
345- signaller .signal .connect (lambda callback , args : self .call_soon (callback , * args ))
345+ self .__call_soon_signal .connect (
346+ lambda callback , args : self .call_soon (callback , * args )
347+ )
346348
347349 assert self .__app is not None
348350 super ().__init__ ()
@@ -438,6 +440,9 @@ def close(self):
438440 if self .__default_executor is not None :
439441 self .__default_executor .shutdown ()
440442
443+ if self .__call_soon_signal :
444+ self .__call_soon_signal .disconnect ()
445+
441446 super ().close ()
442447
443448 self ._timer .stop ()
@@ -524,6 +529,7 @@ def _remove_reader(self, fd):
524529 return False
525530 else :
526531 notifier .setEnabled (False )
532+ notifier .activated ["int" ].disconnect ()
527533 return True
528534
529535 def _add_writer (self , fd , callback , * args ):
@@ -564,6 +570,7 @@ def _remove_writer(self, fd):
564570 return False
565571 else :
566572 notifier .setEnabled (False )
573+ notifier .activated ["int" ].disconnect ()
567574 return True
568575
569576 def __notifier_cb_wrapper (self , notifiers , notifier , fd , callback , args ):
@@ -579,8 +586,6 @@ def __notifier_cb_wrapper(self, notifiers, notifier, fd, callback, args):
579586 # callback. We must not re-enable it in that case.
580587 if notifiers .get (fd , None ) is notifier :
581588 notifier .setEnabled (True )
582- else :
583- notifier .activated ["int" ].disconnect ()
584589
585590 def __on_notifier_ready (self , notifiers , notifier , fd , callback , args ):
586591 if fd not in notifiers :
0 commit comments