Commit 33032bf9 authored by Denis Bilenko's avatar Denis Bilenko

fix reference leak in callbacks.c

parent 66cdeb04
...@@ -53,16 +53,20 @@ static inline void gevent_check_signals(struct PyGeventLoopObject* loop) { ...@@ -53,16 +53,20 @@ static inline void gevent_check_signals(struct PyGeventLoopObject* loop) {
static void gevent_stop(PyObject* watcher, struct PyGeventLoopObject* loop) { static void gevent_stop(PyObject* watcher, struct PyGeventLoopObject* loop) {
PyObject *result, *method; PyObject *result, *method;
int error;
error = 1;
method = PyObject_GetAttrString(watcher, "stop"); // XXX replace with GetAttr method = PyObject_GetAttrString(watcher, "stop"); // XXX replace with GetAttr
if (method) { if (method) {
result = PyObject_Call(method, __pyx_empty_tuple, NULL); result = PyObject_Call(method, __pyx_empty_tuple, NULL);
if (result) { if (result) {
Py_DECREF(result); Py_DECREF(result);
return; error = 0;
} }
Py_DECREF(method); Py_DECREF(method);
} }
gevent_handle_error(loop, watcher); if (error) {
gevent_handle_error(loop, watcher);
}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment