From: Hwankyu Jhun Date: Mon, 12 Aug 2019 06:15:54 +0000 (+0900) Subject: Check whether the instance map is empty X-Git-Tag: submit/tizen/20190813.000210~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=351e2ca94ee24e7b3ff5aa8767885ff080857afb;p=platform%2Fcore%2Fappfw%2Fcomponent-based-application.git Check whether the instance map is empty Change-Id: I02940f87305605f009fd2b4b02cbd79973351217 Signed-off-by: Hwankyu Jhun --- 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);