run face_landmark without leaky memory

This commit is contained in:
zhaodezan 2020-08-26 04:33:45 -04:00
parent 8b5c35210f
commit 73f86c6bb0
2 changed files with 4 additions and 8 deletions

View File

@ -108,7 +108,6 @@ kernel::LiteKernel *KernelRegistry::GetKernel(const std::vector<tensor::Tensor *
<< schema::EnumNamePrimitiveType((schema::PrimitiveType)primitive->Type());
return nullptr;
}
this->op_parameters_.emplace_back(parameter);
auto creator = GetCreator(key);
if (creator != nullptr) {
auto kernel = creator(in_tensors, out_tensors, parameter, ctx, key, primitive);
@ -117,10 +116,5 @@ kernel::LiteKernel *KernelRegistry::GetKernel(const std::vector<tensor::Tensor *
return nullptr;
}
KernelRegistry::~KernelRegistry() {
for (auto op_parameter : op_parameters_) {
free(op_parameter);
}
op_parameters_.clear();
}
KernelRegistry::~KernelRegistry() {}
} // namespace mindspore::lite

View File

@ -73,7 +73,9 @@ class LiteKernel {
this->out_kernels_.clear();
}
virtual ~LiteKernel() = default;
virtual ~LiteKernel() {
free(op_parameter_);
}
virtual int Prepare();