X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_trace_class.i.h;h=f51d619fdfd70f75f5864c3a20bfe230cc03a2c1;hb=7f3ee93db71f587960cf8c0bc12536457c413e45;hp=5e91a6c21553f067473a5fc4ce98dc94ce60c2d8;hpb=5fa16feb3a91ff1f590769707e3886ddb0b4494c;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h b/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h index 5e91a6c2..f51d619f 100644 --- a/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_trace_class.i.h @@ -36,13 +36,16 @@ trace_class_destroyed_listener(const bt_trace_class *trace_class, void *py_calla } py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_class_ptr); - if (py_res) { - BT_ASSERT(py_res == Py_None); - } else { - loge_exception("Trace class's destruction listener (Python)", + if (!py_res) { + loge_exception_append_cause( + "Trace class's destruction listener (Python)", BT_LOG_OUTPUT_LEVEL); + goto end; } + BT_ASSERT(py_res == Py_None); + +end: Py_DECREF(py_trace_class_ptr); Py_XDECREF(py_res); } @@ -56,6 +59,7 @@ int bt_bt2_trace_class_add_destruction_listener( BT_ASSERT(trace_class); BT_ASSERT(py_callable); + status = bt_trace_class_add_destruction_listener( trace_class, trace_class_destroyed_listener, py_callable, id); if (status == __BT_FUNC_STATUS_OK) {