From 51e762e5ee29a540a0e9365d40fbd8c7f7a90882 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 5 Jul 2013 13:37:01 -0400 Subject: [PATCH] Fix: destroy streams for kernel snapshot sessions as well Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- src/common/consumer.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/common/consumer.c b/src/common/consumer.c index 0005b1039..30a95b48f 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -292,21 +292,22 @@ void consumer_del_channel(struct lttng_consumer_channel *channel) pthread_mutex_lock(&consumer_data.lock); + /* Delete streams that might have been left in the stream list. */ + cds_list_for_each_entry_safe(stream, stmp, &channel->streams.head, + send_node) { + cds_list_del(&stream->send_node); + /* + * Once a stream is added to this list, the buffers were created so + * we have a guarantee that this call will succeed. + */ + consumer_stream_destroy(stream, NULL); + } + switch (consumer_data.type) { case LTTNG_CONSUMER_KERNEL: break; case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: - /* Delete streams that might have been left in the stream list. */ - cds_list_for_each_entry_safe(stream, stmp, &channel->streams.head, - send_node) { - cds_list_del(&stream->send_node); - /* - * Once a stream is added to this list, the buffers were created so - * we have a guarantee that this call will succeed. - */ - consumer_stream_destroy(stream, NULL); - } lttng_ustconsumer_del_channel(channel); break; default: -- 2.34.1