mirror of
https://gitee.com/openharmony/deviceprofile_device_info_manager
synced 2024-11-23 07:30:13 +00:00
优化dlclose的使用
Signed-off-by: guoyi <guoyi39@huawei.com>
This commit is contained in:
parent
14550342e2
commit
5691b7f178
@ -431,7 +431,10 @@ bool DeviceProfileManager::LoadDpSyncAdapter()
|
||||
HILOGI("File %{public}s canonicalization failed", soName.c_str());
|
||||
return false;
|
||||
}
|
||||
void *so_handle = dlopen(soName.c_str(), RTLD_NOW);
|
||||
void *so_handle = dlopen(soName.c_str(), RTLD_NOW | RTLD_NOLOAD);
|
||||
if (so_handle == nullptr) {
|
||||
so_handle = dlopen(soName.c_str(), RTLD_NOW);
|
||||
}
|
||||
if (so_handle == nullptr) {
|
||||
HILOGI("load dp sync adapter so %{public}s failed", soName.c_str());
|
||||
return false;
|
||||
@ -453,7 +456,6 @@ bool DeviceProfileManager::LoadDpSyncAdapter()
|
||||
if (dpSyncAdapter_->Initialize() != DP_SUCCESS) {
|
||||
dpSyncAdapter_->Release();
|
||||
dpSyncAdapter_ = nullptr;
|
||||
dlclose(so_handle);
|
||||
isAdapterSoLoaded_ = false;
|
||||
HILOGI("dp sync adapter init failed");
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user