[pygobject/benzea/gio-asyncio] del source everywhere



commit 826848571ab4507bf959aea681c07d2e19ee9c70
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Oct 28 10:46:50 2021 +0200

    del source everywhere

 gi/events.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/events.py b/gi/events.py
index 11a58f51..6ace881d 100644
--- a/gi/events.py
+++ b/gi/events.py
@@ -145,6 +145,7 @@ class EventLoop(asyncio.SelectorEventLoop):
             source.set_callback(self._signal_cb, sig)
 
             self.__signal_handlers[sig] = (source, callback, args)
+            del source
 
         def remove_signal_handler(self, sig):
             if sig not in { signal.SIGHUP, signal.SIGINT, signal.SIGTERM, signal.SIGUSR1, signal.SIGUSR2, 
signal.SIGWINCH }:
@@ -153,8 +154,6 @@ class EventLoop(asyncio.SelectorEventLoop):
             try:
                 source, _, _ = self.__signal_handlers[sig]
                 source.destroy()
-                # Make sure the GSource is finalized
-                source.set_callback(None)
                 del source
                 del self.__signal_handlers[sig]
 
@@ -175,6 +174,7 @@ class EventLoop(asyncio.SelectorEventLoop):
 
         def _signal_cb(self, sig):
             source, cb, args = self.__signal_handlers.get(sig)
+            del source
 
             # Pass over to python mainloop
             self.call_soon(cb, *args)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]