diff --git a/Services/SystemMenu/main.cpp b/Services/SystemMenu/main.cpp index 1b7554c2e5..8a6ad8aa75 100644 --- a/Services/SystemMenu/main.cpp +++ b/Services/SystemMenu/main.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include //#define SYSTEM_MENU_DEBUG @@ -163,8 +164,12 @@ NonnullRefPtr build_system_menu() const auto& bin = g_apps[app_identifier].executable; pid_t child_pid; const char* argv[] = { bin.characters(), nullptr }; - if ((errno = posix_spawn(&child_pid, bin.characters(), nullptr, nullptr, const_cast(argv), environ))) + if ((errno = posix_spawn(&child_pid, bin.characters(), nullptr, nullptr, const_cast(argv), environ))) { perror("posix_spawn"); + } else { + if (disown(child_pid) < 0) + perror("disown"); + } })); ++app_identifier; }