summaryrefslogtreecommitdiff
path: root/examples/llava/clip.cpp
diff options
context:
space:
mode:
authorFelix <stenbackfelix@gmail.com>2024-03-18 16:40:22 +0100
committerGitHub <noreply@github.com>2024-03-18 17:40:22 +0200
commit104f5e0fc156d48476258295457cafeec2a2af10 (patch)
treebb959c404682f246ceb0f9970ec845dc0612a549 /examples/llava/clip.cpp
parent5e1b7f94a03e0b3b8e4578625bbdadc7bbd2b93c (diff)
clip : fix memory leak (#6138)
Diffstat (limited to 'examples/llava/clip.cpp')
-rw-r--r--examples/llava/clip.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp
index a0ed82d7..690bca2e 100644
--- a/examples/llava/clip.cpp
+++ b/examples/llava/clip.cpp
@@ -497,7 +497,6 @@ struct clip_ctx {
// memory buffers to evaluate the model
ggml_backend_buffer_t params_buffer = NULL;
- ggml_backend_buffer_t compute_buffer = NULL;
ggml_backend_t backend = NULL;
ggml_gallocr_t compute_alloc = NULL;
@@ -1676,6 +1675,9 @@ void clip_free(clip_ctx * ctx) {
ggml_free(ctx->ctx_data);
gguf_free(ctx->ctx_gguf);
+ ggml_backend_buffer_free(ctx->params_buffer);
+ ggml_backend_free(ctx->backend);
+ ggml_gallocr_free(ctx->compute_alloc);
delete ctx;
}