Merge pull request #24 from NexaAI/weili/master-release

[memory leakage] fixed a leakage by projector free
This commit is contained in:
Zack Li 2024-11-13 17:16:39 -08:00 committed by GitHub
commit b9845b4f63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,7 @@
#include <thread>
#include <vector>
#include <cstring>
#include <iostream>
//
// 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);