mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-24 14:32:03 +00:00
Fixed double-free in LLModel::Implementation destructor
This commit is contained in:
parent
ae20274a1d
commit
ab56119470
@ -34,8 +34,17 @@ LLModel::Implementation::Implementation(Dlhandle &&dlhandle_) : dlhandle(new Dlh
|
|||||||
assert(construct_);
|
assert(construct_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLModel::Implementation::Implementation(Implementation &&o)
|
||||||
|
: construct_(o.construct_)
|
||||||
|
, modelType(o.modelType)
|
||||||
|
, buildVariant(o.buildVariant)
|
||||||
|
, magicMatch(o.magicMatch)
|
||||||
|
, dlhandle(o.dlhandle) {
|
||||||
|
o.dlhandle = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
LLModel::Implementation::~Implementation() {
|
LLModel::Implementation::~Implementation() {
|
||||||
delete dlhandle;
|
if (dlhandle) delete dlhandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLModel::Implementation::isImplementation(const Dlhandle &dl) {
|
bool LLModel::Implementation::isImplementation(const Dlhandle &dl) {
|
||||||
|
@ -17,6 +17,8 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
Implementation(Dlhandle&&);
|
Implementation(Dlhandle&&);
|
||||||
|
Implementation(const Implementation&) = delete;
|
||||||
|
Implementation(Implementation&&);
|
||||||
~Implementation();
|
~Implementation();
|
||||||
|
|
||||||
static bool isImplementation(const Dlhandle&);
|
static bool isImplementation(const Dlhandle&);
|
||||||
|
Loading…
Reference in New Issue
Block a user