Add function call to clear memory db 99/255999/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 26 Mar 2021 08:57:18 +0000 (17:57 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 26 Mar 2021 08:57:18 +0000 (17:57 +0900)
Change-Id: I9f73721835195241053cd32a1c39696b77b5e2ac
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/installer/app_installer.cc
src/common/installer_runner.cc

index a2c31bd..caed2af 100644 (file)
@@ -9,6 +9,8 @@
 #include <fstream>
 #include <TTraceWrapper.h>
 
+#include <pkgmgr_parser_db.h>
+
 #include "common/installer/app_installer.h"
 #include "common/installer_context.h"
 #include "common/pkgmgr_interface.h"
@@ -202,8 +204,10 @@ 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();
index a5f8646..c98432f 100644 (file)
@@ -85,12 +85,12 @@ AppInstaller::Result InstallerRunner::Run() {
       break;
   }
   if (it != installers_.end() && result == AppInstaller::Result::ERROR) {
+    pkgmgr_parser_clear_cache_memory_db();
     do {
       AppInstaller::Result ret = (*it)->Undo();
       if (ret != AppInstaller::Result::OK && ret != AppInstaller::Result::ERROR)
         result = AppInstaller::Result::UNDO_ERROR;
     } while (it-- != installers_.begin());
-    pkgmgr_parser_clear_cache_memory_db();
   } else {
     pkgmgr_parser_clear_cache_memory_db();
     if (pkgmgr_->GetRequestType() != RequestType::Recovery)