[pygobject] Add consistent GLib.MainLoop SIGINT cleanup
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Add consistent GLib.MainLoop SIGINT cleanup
- Date: Mon, 28 Oct 2013 05:33:44 +0000 (UTC)
commit 57195c9c864bc25521bb3cb98286e6d6f0645652
Author: Simon Feltman <sfeltman src gnome org>
Date: Sun Oct 27 16:02:13 2013 -0700
Add consistent GLib.MainLoop SIGINT cleanup
Remove auto cleanup of SIGINT source handling by returning True from the
signal callback. This gives the __del__ method consistent cleanup semantics
regardless of whether or not a SIGINT occurred.
https://bugzilla.gnome.org/show_bug.cgi?id=710978
gi/overrides/GLib.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index 8f18682..fc25882 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -507,6 +507,10 @@ class MainLoop(GLib.MainLoop):
def _handler(loop):
loop.quit()
loop._quit_by_sigint = True
+ # We handle signal deletion in __del__, return True so GLib
+ # doesn't do the deletion for us.
+ return True
+
if sys.platform != 'win32':
# compatibility shim, keep around until we depend on glib 2.36
if hasattr(GLib, 'unix_signal_add'):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]