security-manager: Ensure app cleanup in ScopedAppLauncher 43/323443/2
authorFilip Skrzeczkowski <f.skrzeczkow@samsung.com>
Mon, 28 Apr 2025 10:35:07 +0000 (12:35 +0200)
committerKrzysztof Małysa <k.malysa@samsung.com>
Mon, 28 Apr 2025 13:59:04 +0000 (13:59 +0000)
Make sure that cleanupApp is called in the ScopedAppLauncher
destructor even if everything else fails

Change-Id: Ife73ededce3b42e3e4a19534a169e78ce029969c

src/security-manager-tests/common/scoped_app_launcher.cpp

index 6861bab70677cca1ad869f943a49be21e3b55781..6a48b1617a6217002a92cbcd94d3878c8cf25b0c 100644 (file)
@@ -56,6 +56,10 @@ ScopedAppLauncher::~ScopedAppLauncher()
     SafeCleanup::run([this]{
         m_syncPipe.post();
         waitPid(m_pid);
+    });
+
+    // Cleanup app even if everything else fails
+    SafeCleanup::run([this]{
         Api::cleanupApp(m_appId, m_uid, m_pid);
     });
 }