Skip to content

Commit

Permalink
fix(src/cli/cli.cc): fix signal handling race on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Nov 28, 2023
1 parent 1cf8880 commit a9e45e2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/cli/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1000,14 +1000,18 @@ int runApp (const Path& path, const String& args, bool headless) {

appPid = appProcess->open();
appProcess->wait();
auto status = appProcess->status.load();
std::lock_guard<std::mutex> lock(appMutex);

if (status > -1) {
appStatus = status;
}
if (appProcess != nullptr) {
auto status = appProcess->status.load();

delete appProcess;
appProcess = nullptr;
if (status > -1) {
appStatus = status;
}

delete appProcess;
appProcess = nullptr;
}

log("App result: " + std::to_string(appStatus));
return appStatus;
Expand Down

0 comments on commit a9e45e2

Please sign in to comment.