Fix static analysis issues 48/305148/4
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 29 Jan 2024 09:18:27 +0000 (18:18 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 29 Jan 2024 21:36:43 +0000 (06:36 +0900)
- Use std::move()
- Add a missing lock

Change-Id: Ia9e74a62c8de6222c0d02c12a2d9da1b8ca7ceb0
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/service_app_main.cc

index 981f95d..673dd4a 100644 (file)
@@ -111,7 +111,7 @@ class AppContext : public AppCoreBase {
   }
 
   int OnReceive(aul_type type, tizen_base::Bundle b) override {
-    AppCoreBase::OnReceive(type, b);
+    AppCoreBase::OnReceive(type, std::move(b));
 
     if (type == AUL_TERMINATE_BGAPP) {
       // LCOV_EXCL_START
@@ -205,6 +205,7 @@ class AppContext : public AppCoreBase {
   }
 
   AppState GetAppState() const {
+    std::lock_guard<std::recursive_mutex> lock(mutex_);
     return state_;
   }