From 351e2ca94ee24e7b3ff5aa8767885ff080857afb Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 12 Aug 2019 15:15:54 +0900 Subject: [PATCH] Check whether the instance map is empty Change-Id: I02940f87305605f009fd2b4b02cbd79973351217 Signed-off-by: Hwankyu Jhun --- component_based/base/component_manager_internal.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/component_based/base/component_manager_internal.cc b/component_based/base/component_manager_internal.cc index 99fb6cf..f2bee5b 100644 --- a/component_based/base/component_manager_internal.cc +++ b/component_based/base/component_manager_internal.cc @@ -144,6 +144,9 @@ void ComponentManager::Exit(const std::string& inst_id) { } void ComponentManager::ExitAll() { + if (inst_map_.empty()) + return; + for (auto i = inst_map_.begin(); i != inst_map_.end(); i++) { LOGD("Exit instance(%s)", i->first.c_str()); Exit(i->first); @@ -244,6 +247,9 @@ bool ComponentManager::IsEmpty() { } void ComponentManager::ResumeAll() { + if (inst_map_.empty()) + return; + for (auto i = inst_map_.begin(); i != inst_map_.end(); i++) { LOGD("Resume instance(%s)", i->first.c_str()); Resume(i->first); @@ -251,6 +257,9 @@ void ComponentManager::ResumeAll() { } void ComponentManager::PauseAll() { + if (inst_map_.empty()) + return; + for (auto i = inst_map_.begin(); i != inst_map_.end(); i++) { LOGD("Pause instance(%s)", i->first.c_str()); Pause(i->first); -- 2.34.1