diff --git a/interfaces/inner_api/modulemgr/src/module_manager.cpp b/interfaces/inner_api/modulemgr/src/module_manager.cpp index 019cf1e8ce45a83b080040c6e8740bd759eb64e2..3ee6203da29cc1457a0482fa48ad74050cb92e86 100644 --- a/interfaces/inner_api/modulemgr/src/module_manager.cpp +++ b/interfaces/inner_api/modulemgr/src/module_manager.cpp @@ -128,6 +128,15 @@ void ModuleManager::HandleOnStartOnStopFunc(std::string phase, const OHOS::Syste } UTILS_LOGD("HandleOnStartOnStopFunc phase %{public}s exist", phase.c_str()); ((LifeCycleFuncType)onStartOnStopFuncMap_[phase])(reason); + if (phase == "OnStop") { + if (dueModuleHandler != nullptr) { + UTILS_LOGD("onstop"); + isLoaded = false; + dlclose(dueModuleHandler); + dueModuleHandler = nullptr; + UTILS_LOGD("dlclose so over"); + } + } } void ModuleManager::HookOnIdleFunc(std::string phase, LifeCycleFuncReturnType handleSAOnIdle)