Skip to content

Commit 104f5e0

Browse files
authored
clip : fix memory leak (#6138)
1 parent 5e1b7f9 commit 104f5e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/llava/clip.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ struct clip_ctx {
497497

498498
// memory buffers to evaluate the model
499499
ggml_backend_buffer_t params_buffer = NULL;
500-
ggml_backend_buffer_t compute_buffer = NULL;
501500

502501
ggml_backend_t backend = NULL;
503502
ggml_gallocr_t compute_alloc = NULL;
@@ -1676,6 +1675,9 @@ void clip_free(clip_ctx * ctx) {
16761675
ggml_free(ctx->ctx_data);
16771676
gguf_free(ctx->ctx_gguf);
16781677

1678+
ggml_backend_buffer_free(ctx->params_buffer);
1679+
ggml_backend_free(ctx->backend);
1680+
ggml_gallocr_free(ctx->compute_alloc);
16791681
delete ctx;
16801682
}
16811683

0 commit comments

Comments
 (0)