Notification time stamped 2019-04-30 19:31:07 UTC
From 8a08a0c8a8da503b18f2fbb15194c5f3728a689a Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam(a)redhat.com>
Date: Apr 30 2019 19:30:08 +0000
Subject: Apply fix suggested by ncoghlan for crash-on-exit bug (#1632039)
---
diff --git a/0001-Python-plugin-Call-EndInterpreter-when-deinit-ing-th.patch
b/0001-Python-plugin-Call-EndInterpreter-when-deinit-ing-th.patch
new file mode 100644
index 0000000..e67fef7
--- /dev/null
+++ b/0001-Python-plugin-Call-EndInterpreter-when-deinit-ing-th.patch
@@ -0,0 +1,31 @@
+From d9c637ae8a1137d3ca512d2c560589903a4bd79d Mon Sep 17 00:00:00 2001
+From: Adam Williamson <awilliam(a)redhat.com>
+Date: Tue, 30 Apr 2019 11:16:01 -0700
+Subject: [PATCH] Python plugin: Call EndInterpreter when deinit'ing the plugin
+
+This fixes
https://github.com/hexchat/hexchat/issues/2237 , a
+commonly-encountered bug when using Hexchat 2.14 on Python 3.7.
+Thanks to @ncoghlan for the fix.
+
+Signed-off-by: Adam Williamson <awilliam(a)redhat.com>
+---
+ plugins/python/python.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/plugins/python/python.c b/plugins/python/python.c
+index 4403474d..475756ba 100644
+--- a/plugins/python/python.c
++++ b/plugins/python/python.c
+@@ -2806,6 +2806,9 @@ hexchat_plugin_deinit(void)
+ xchatout_buffer = NULL;
+
+ if (interp_plugin) {
++ PyThreadState *tstate = ((PluginObject*)interp_plugin)->tstate;
++ PyThreadState_Swap(tstate);
++ Py_EndInterpreter(tstate);
+ Py_DECREF(interp_plugin);
+ interp_plugin = NULL;
+ }
+--
+2.21.0
+
diff --git a/hexchat.spec b/hexchat.spec
index c3f7764..60af1fc 100644
--- a/hexchat.spec
+++ b/hexchat.spec
@@ -3,10 +3,15 @@
Summary: A popular and easy to use graphical IRC (chat) client
Name: hexchat
Version: 2.14.2
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+
URL:
https://hexchat.github.io
Source:
https://dl.hexchat.net/hexchat/%{name}-%{version}.tar.xz
+#
https://github.com/hexchat/hexchat/issues/2237
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1632039
+# thanks ncoghlan for the fix
+# not upstreamed as there is no stable 2.14 branch to upstream it to
+Patch0: 0001-Python-plugin-Call-EndInterpreter-when-deinit-ing-th.patch
BuildRequires: gcc
BuildRequires: meson
@@ -72,6 +77,9 @@ This package contains the development files for %{name}.
%{_libdir}/pkgconfig/hexchat-plugin.pc
%changelog
+* Tue Apr 30 2019 Adam Williamson <awilliam(a)redhat.com> - 2.14.2-3
+- Apply a fix suggested by ncoghlan for the crash-on-exit bug (#1632039)
+
* Fri Feb 01 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.14.2-2
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
https://src.fedoraproject.org/rpms/hexchat/c/8a08a0c8a8da503b18f2fbb15194...