X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_trace.i.h;h=26404afb9c6714e4b808d8e10f378d2e415e6c2b;hp=03e6380acf2627e77197862c71a9217b7bb6bb46;hb=7f3ee93db71f587960cf8c0bc12536457c413e45;hpb=27ba49f1181a4d1a046f1bc6116b4a8715e8ed37 diff --git a/src/bindings/python/bt2/bt2/native_bt_trace.i.h b/src/bindings/python/bt2/bt2/native_bt_trace.i.h index 03e6380a..26404afb 100644 --- a/src/bindings/python/bt2/bt2/native_bt_trace.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_trace.i.h @@ -36,14 +36,16 @@ trace_destroyed_listener(const bt_trace *trace, void *py_callable) } py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_ptr); - if (py_res) { - BT_ASSERT(py_res == Py_None); - } else { + if (!py_res) { loge_exception_append_cause( "Trace's destruction listener (Python)", BT_LOG_OUTPUT_LEVEL); + goto end; } + BT_ASSERT(py_res == Py_None); + +end: Py_DECREF(py_trace_ptr); Py_XDECREF(py_res); }