Skip to content

Commit 266fca5

Browse files
committed
Fix timerfd reader not being removed from asyncio loop
The copy pasted code in the timer fd paths removed the bus fd. Thanks @ofacklam for noticing it.
1 parent fe49edb commit 266fca5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/sdbus/sd_bus_internals_bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static void SdBus_dealloc(SdBusObject* self) {
3030
Py_XDECREF(PyObject_CallMethodObjArgs(self->loop, remove_writer_str, self->bus_fd, NULL));
3131
}
3232
if (NULL != self->timer_fd) {
33-
Py_XDECREF(PyObject_CallMethodObjArgs(self->loop, remove_reader_str, self->bus_fd, NULL));
33+
Py_XDECREF(PyObject_CallMethodObjArgs(self->loop, remove_reader_str, self->timer_fd, NULL));
3434
Py_DECREF(self->timer_fd);
3535
close(self->timer_fd_int);
3636
}
@@ -631,7 +631,7 @@ static PyObject* SdBus_close(SdBusObject* self, PyObject* Py_UNUSED(args)) {
631631
Py_XDECREF(CALL_PYTHON_AND_CHECK(PyObject_CallMethodObjArgs(self->loop, remove_writer_str, self->bus_fd, NULL)));
632632
}
633633
if (NULL != self->timer_fd) {
634-
Py_XDECREF(PyObject_CallMethodObjArgs(self->loop, remove_reader_str, self->bus_fd, NULL));
634+
Py_XDECREF(PyObject_CallMethodObjArgs(self->loop, remove_reader_str, self->timer_fd, NULL));
635635
// TODO: Close timerfd
636636
}
637637
Py_RETURN_NONE;

0 commit comments

Comments
 (0)