Check whether the instance map is empty 29/211929/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 12 Aug 2019 06:15:54 +0000 (15:15 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 12 Aug 2019 06:15:54 +0000 (15:15 +0900)
Change-Id: I02940f87305605f009fd2b4b02cbd79973351217
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
component_based/base/component_manager_internal.cc

index 99fb6cf9d42e9d0e60fb787bca3cd29cd72c0824..f2bee5bd5d76c2a881d0282866e0526e772a9a24 100644 (file)
@@ -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);