From: Julien Desfossez Date: Fri, 5 Jul 2013 17:37:01 +0000 (-0400) Subject: Fix: destroy streams for kernel snapshot sessions as well X-Git-Tag: v2.3.0-rc1~71 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=51e762e5ee29a540a0e9365d40fbd8c7f7a90882;p=lttng-tools.git Fix: destroy streams for kernel snapshot sessions as well Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- 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: