Fixed double-free in LLModel::Implementation destructor

pull/793/head
niansa 1 year ago committed by AT
parent f74363bb3a
commit 5175db2781

@ -34,8 +34,17 @@ LLModel::Implementation::Implementation(Dlhandle &&dlhandle_) : dlhandle(new Dlh
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() {
delete dlhandle;
if (dlhandle) delete dlhandle;
}
bool LLModel::Implementation::isImplementation(const Dlhandle &dl) {

@ -17,6 +17,8 @@ public:
public:
Implementation(Dlhandle&&);
Implementation(const Implementation&) = delete;
Implementation(Implementation&&);
~Implementation();
static bool isImplementation(const Dlhandle&);

Loading…
Cancel
Save