Prevent exceptions in ScopedInstaller destructor 86/109786/4
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 11 Jan 2017 13:57:47 +0000 (14:57 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Sat, 18 Mar 2017 12:35:27 +0000 (13:35 +0100)
Change-Id: Ibc52d27f0c0dd0cdb30233481a70e336b5302a73

src/security-manager-tests/common/scoped_installer.h

index 639aa11..a495dfb 100644 (file)
@@ -31,6 +31,7 @@
 #include <sm_api.h>
 #include <temp_test_user.h>
 #include <synchronization_pipe.h>
+#include <dpl/test/safe_cleanup.h>
 
 class ScopedInstaller {
 public:
@@ -83,7 +84,9 @@ public:
 
     virtual ~ScopedInstaller() {
         if (m_creatorPid == getpid())
-            uninstallApp();
+        {
+            SafeCleanup::run([this]{ uninstallApp(); });
+        }
     }
 
     void uninstallApp() {