Clear memory db before sending the finish signal 86/279286/1
authorIlho Kim <ilho159.kim@samsung.com>
Fri, 5 Aug 2022 06:13:12 +0000 (15:13 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Fri, 5 Aug 2022 06:30:20 +0000 (15:30 +0900)
Because installer can write to db during undo or clear operation
such as UninstallSteps, the client who received the finish signal
may take the wrong package information

Change-Id: I62d674e4b37692fabdee45287c99dce202616b87
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/installer/app_installer.cc

index 47f9a29..bdef968 100644 (file)
@@ -207,10 +207,8 @@ AppInstaller::Result AppInstaller::Run() {
   Process();
   if (it_ != steps_.end() && result_ == Result::ERROR) {
     LOG(ERROR) << "Failure occurs in step: " << (*it_)->name();
-    pkgmgr_parser_clear_cache_memory_db();
     Undo();
   } else {
-    pkgmgr_parser_clear_cache_memory_db();
     Clean();
   }
   sync();
@@ -872,6 +870,8 @@ void AppInstaller::SendProgress(int progress) {
 }
 
 void AppInstaller::SendFinished(Step::Status process_status) {
+  pkgmgr_parser_clear_cache_memory_db();
+
   if (!SendStartIfNotSent(false))
     return;