Example #1
0
void bt_iter_fini(struct bt_iter *iter)
{
	assert(iter);
	if (iter->stream_heap) {
		bt_heap_free(iter->stream_heap);
		g_free(iter->stream_heap);
	}
	iter->ctx->current_iterator = NULL;
	bt_context_put(iter->ctx);
}
Example #2
0
static void
ctf_destroy (void)
{
  if (ctf_iter != NULL)
    {
      bt_ctf_iter_destroy (ctf_iter);
      ctf_iter = NULL;
    }
  if (ctx != NULL)
    {
      bt_context_put (ctx);
      ctx = NULL;
    }
}
Example #3
0
struct bt_context *create_context_with_path(const char *path)
{
	struct bt_context *ctx;
	int ret;

	ctx = bt_context_create();
	if (!ctx) {
		return NULL;
	}

	ret = bt_context_add_trace(ctx, path, "ctf", NULL, NULL, NULL);
	if (ret < 0) {
		bt_context_put(ctx);
		return NULL;
	}
	return ctx;
}
Example #4
0
void lttv_traceset_destroy(LttvTraceset *s) 
{
	guint i;

	for(i=0;i<s->traces->len;i++) {
		LttvTrace *trace = g_ptr_array_index(s->traces, i);
		lttv_trace_unref(trace);
		// todo mdenis 2012-03-27: uncomment when babeltrace gets fixed
		//bt_context_remove_trace(lttv_traceset_get_context(s), trace->id);
		if(lttv_trace_get_ref_number(trace) == 0)
			lttv_trace_destroy(trace);
	}
	free(s->common_path);
	g_ptr_array_free(s->traces, TRUE);
	bt_context_put(s->context);
	g_object_unref(s->a);
	g_free(s);
}