+
+static
+void remove_trace_handle(struct bt_trace_handle *handle)
+{
+ int ret;
+
+ /* Remove from containers */
+ bt_trace_collection_remove(handle->td->ctx->tc, handle->td);
+ /* Close the trace */
+ ret = handle->format->close_trace(handle->td);
+ if (ret) {
+ fprintf(stderr, "Error in close_trace callback\n");
+ }
+
+ bt_trace_handle_destroy(handle);
+}