From f151f4c165086d267dfb4d48f48ce1f3381b7d6f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Jun 2019 20:36:53 +0530 Subject: [PATCH] Detach the stdin write thread so that it is auto-cleaned up --- kitty/child-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index 638f9f162..5be6fbfa8 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -231,7 +231,6 @@ start(PyObject *s, PyObject *a UNUSED) { Py_RETURN_NONE; } - static PyObject * wakeup(PYNOARG) { #define wakeup_doc "wakeup() -> wakeup the ChildMonitor I/O thread, forcing it to exit from poll() if it is waiting there." @@ -793,6 +792,7 @@ cm_thread_write(PyObject UNUSED *self, PyObject *args) { memcpy(data->buf, buf, data->sz); int ret = pthread_create(&thread, NULL, thread_write, data); if (ret != 0) { free_twd(data); return PyErr_SetFromErrno(PyExc_OSError); } + pthread_detach(thread); Py_RETURN_NONE; }