From c57f94f38d8c164cf9c65def107dc98a65b69ac3 Mon Sep 17 00:00:00 2001 From: jeka Date: Tue, 21 Apr 2026 15:18:09 +0300 Subject: [PATCH] 1 --- lib/memory_pool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/memory_pool.c b/lib/memory_pool.c index dfb394bb..98b3c548 100644 --- a/lib/memory_pool.c +++ b/lib/memory_pool.c @@ -79,16 +79,18 @@ void memory_pool_destroy(struct memory_pool* pool) { return; } - DEBUG_INFO(DEBUG_CATEGORY_MEMORY, "pool_destroy: allocations=%zu, reuse=%zu", pool->allocations, pool->reuse_count); - + int cnt=0; // Освободить все объекты в пуле void* obj = pool->free_head; while (obj) { void* next = *(void**)obj; u_free(obj); + cnt++; obj = next; } + DEBUG_INFO(DEBUG_CATEGORY_MEMORY, "pool_destroy: allocations=%zu, reuse=%zu, current pool size=%d", pool->allocations, pool->reuse_count, cnt); + pool->free_head = NULL; pool->free_count = 0; u_free(pool);