diff --git a/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp b/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp index 0188d46169fe7c300c2981a26c559f8b72c7d182..09e20ad61e95a45251c5611be12db1e5e266e0bf 100644 --- a/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp +++ b/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp @@ -184,7 +184,7 @@ void ComponentLoader::GetAllHandler(std::map &dhtypeMap) comHandler.hardwareHandler = GetHandler(itor->second.compHandlerLoc); comHandler.sinkHandler = GetHandler(itor->second.compSinkLoc); comHandler.sourceHandler = GetHandler(itor->second.compSourceLoc); - compHandlerMap_.insert(std::pair(itor->second.type, comHandler)); + compHandlerMap_[itor->second.type] = comHandler; } } diff --git a/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp b/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp index ff4cbc922a49dfd1b35440b104c07a1e9b1983ec..11da1172bc4869f36bf9b65b28325ff590c7ff93 100644 --- a/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp +++ b/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp @@ -54,18 +54,19 @@ IMPLEMENT_SINGLE_INSTANCE(DistributedHardwareManager); int32_t DistributedHardwareManager::Initialize() { DHLOGI("start"); - CapabilityInfoManager::GetInstance()->Init(); VersionInfoManager::GetInstance()->Init(); ComponentLoader::GetInstance().Init(); - LocalHardwareManager::GetInstance().Init(); - VersionManager::GetInstance().Init(); ComponentManager::GetInstance().Init(); + CapabilityInfoManager::GetInstance()->Init(); + + LocalHardwareManager::GetInstance().Init(); + return DH_FWK_SUCCESS; } @@ -74,18 +75,18 @@ int32_t DistributedHardwareManager::Release() DHLOGI("start"); TaskBoard::GetInstance().WaitForALLTaskFinish(); + LocalHardwareManager::GetInstance().UnInit(); + + CapabilityInfoManager::GetInstance()->UnInit(); + ComponentManager::GetInstance().UnInit(); VersionManager::GetInstance().UnInit(); - LocalHardwareManager::GetInstance().UnInit(); - ComponentLoader::GetInstance().UnInit(); VersionInfoManager::GetInstance()->UnInit(); - CapabilityInfoManager::GetInstance()->UnInit(); - return DH_FWK_SUCCESS; }