From fc25544867f591e0831dea493675ff0d8775dfc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=BA?= Date: Thu, 14 Nov 2024 08:32:55 +0800 Subject: [PATCH] [memory leakage] fixed a leakage by projector free --- examples/qwen2-audio/qwen2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/qwen2-audio/qwen2.cpp b/examples/qwen2-audio/qwen2.cpp index 71b2a4a12..a42b85bdc 100644 --- a/examples/qwen2-audio/qwen2.cpp +++ b/examples/qwen2-audio/qwen2.cpp @@ -18,6 +18,7 @@ #include #include #include +#include // // Constants @@ -708,6 +709,7 @@ void omni_free(struct omni_context *ctx_omni) if(internal_chars != nullptr) { free(internal_chars); + internal_chars = nullptr; } if (ctx_omni->ctx_whisper) { @@ -716,7 +718,7 @@ void omni_free(struct omni_context *ctx_omni) } if (ctx_omni->projector) { - ctx_omni->projector->free(); + delete ctx_omni->projector; } llama_free(ctx_omni->ctx_llama);