X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=d45707b763deaf653b3ed75f65c80a3f5ed42b55;hp=7dfcf9a3cf46381675222dfbcb94a474e0e8eaa9;hb=b83e03c49920557f292d3861f42d0109e6fa03ea;hpb=c585821bc78955b3d747fcd733aa1d2b81a3258e diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 7dfcf9a3c..d45707b76 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -82,6 +82,7 @@ static void destroy_channel(struct lttng_consumer_channel *channel) */ if (channel->uchan) { lttng_ustconsumer_del_channel(channel); + lttng_ustconsumer_free_channel(channel); } free(channel); } @@ -1830,8 +1831,6 @@ void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan) if (chan->switch_timer_enabled == 1) { consumer_timer_switch_stop(chan); } - consumer_metadata_cache_destroy(chan); - ustctl_destroy_channel(chan->uchan); for (i = 0; i < chan->nr_stream_fds; i++) { int ret; @@ -1852,7 +1851,6 @@ void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan) } } } - free(chan->stream_fds); /* Try to rmdir all directories under shm_path root. */ if (chan->root_shm_path[0]) { (void) run_as_recursive_rmdir(chan->root_shm_path, @@ -1860,6 +1858,16 @@ void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan) } } +void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan) +{ + assert(chan); + assert(chan->uchan); + + consumer_metadata_cache_destroy(chan); + ustctl_destroy_channel(chan->uchan); + free(chan->stream_fds); +} + void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream) { assert(stream);