diff options
author | Simon McVittie <smcv@debian.org> | 2010-12-02 16:31:07 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2010-12-02 16:31:07 +0000 |
commit | 56ad64cd14e52b479489549f76343f19e3842139 (patch) | |
tree | 645b786f39e8fa58247a3b69d9e5754ed18c9319 /test/dbus_py_test.c | |
parent | cb1bbd2414e892469023653ea7ddd5d39cd76b84 (diff) |
Use Py_CLEAR for greater robustness
Diffstat (limited to 'test/dbus_py_test.c')
-rw-r--r-- | test/dbus_py_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/dbus_py_test.c b/test/dbus_py_test.c index 5604e32..a98c4d7 100644 --- a/test/dbus_py_test.c +++ b/test/dbus_py_test.c @@ -88,19 +88,19 @@ UnusableMainLoop (PyObject *always_null UNUSED, PyObject *args, PyObject *kwargs if (mainloop && set_as_default) { if (!_dbus_bindings_module) { PyErr_SetString(PyExc_ImportError, "_dbus_bindings not imported"); - Py_DECREF(mainloop); + Py_CLEAR(mainloop); return NULL; } function = PyObject_GetAttrString(_dbus_bindings_module, "set_default_main_loop"); if (!function) { - Py_DECREF(mainloop); + Py_CLEAR(mainloop); return NULL; } result = PyObject_CallFunctionObjArgs(function, mainloop, NULL); - Py_DECREF(function); + Py_CLEAR(function); if (!result) { - Py_DECREF(mainloop); + Py_CLEAR(mainloop); return NULL; } } |