From 37d7bb4881a97aefae6e3aa7d9c23f6e354662ae Mon Sep 17 00:00:00 2001 From: radkesvat <134321679+radkesvat@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:51:03 +0000 Subject: [PATCH] fix bug --- ww/buffer_stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ww/buffer_stream.c b/ww/buffer_stream.c index ec62f010..bd2ec0c2 100644 --- a/ww/buffer_stream.c +++ b/ww/buffer_stream.c @@ -13,11 +13,12 @@ buffer_stream_t *newBufferStream(struct buffer_pool_s *pool) void empytBufferStream(buffer_stream_t *self) { c_foreach(i, queue, self->q) { reuseBuffer(self->pool, *i.ref); } + queue_clear(&self->q); } void destroyBufferStream(buffer_stream_t *self) { - empytBufferStream(self); + c_foreach(i, queue, self->q) { reuseBuffer(self->pool, *i.ref); } queue_drop(&self->q); free(self); }