mirror of
https://gitee.com/openharmony/ai_neural_network_runtime
synced 2024-12-04 05:50:44 +00:00
nnrt memory leak fixed 2.0
Signed-off-by: w30052974 <wangyifan94@huawei.com>
This commit is contained in:
parent
e4000e4be3
commit
e25f0d30db
@ -48,11 +48,13 @@ NNRtServiceApi& NNRtServiceApi::GetInstance()
|
||||
|
||||
// Assumes there can be multiple instances of NN API
|
||||
std::string nnrtLibraryName = "libdllite_service_client.z.so";
|
||||
libNNRtService = dlopen(nnrtLibraryName.c_str(), RTLD_LAZY | RTLD_NODELETE);
|
||||
if (libNNRtService == nullptr) {
|
||||
LOGE("LoadNNRtService error: unable to open library %{public}s", nnrtLibraryName.c_str());
|
||||
nnrtService.m_serviceAvailable = false;
|
||||
return nnrtService;
|
||||
libNNRtService = dlopen(nnrtLibraryName.c_str(), RTLD_LAZY | RTLD_NODELETE);
|
||||
if (libNNRtService == nullptr) {
|
||||
LOGE("LoadNNRtService error: unable to open library %{public}s", nnrtLibraryName.c_str());
|
||||
nnrtService.m_serviceAvailable = false;
|
||||
return nnrtService;
|
||||
}
|
||||
}
|
||||
|
||||
LoadFunction(libNNRtService, "CheckModelSizeFromPath", &nnrtService.CheckModelSizeFromPath);
|
||||
|
Loading…
Reference in New Issue
Block a user