mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-21 18:39:59 +00:00
Fix issue where quitting app no longer works after exiting a process in stream
This commit is contained in:
parent
1e2faea1ac
commit
daaec4ba46
@ -42,6 +42,13 @@ int exe(const std::string &cmd, bp::environment &env, file_t &file, std::error_c
|
||||
}
|
||||
|
||||
int proc_t::execute(int app_id) {
|
||||
if(!_process.running() && _app_id != -1) {
|
||||
// previous process exited on it's own, reset _process_handle
|
||||
_process_handle = bp::group();
|
||||
|
||||
_app_id = -1;
|
||||
}
|
||||
|
||||
if(app_id >= _apps.size()) {
|
||||
std::cout << "Error: Couldn't find app with ID ["sv << app_id << ']' << std::endl;
|
||||
|
||||
@ -115,6 +122,7 @@ void proc_t::terminate() {
|
||||
|
||||
// Ensure child process is terminated
|
||||
process_end(_process, _process_handle);
|
||||
_app_id = -1;
|
||||
|
||||
if(ec) {
|
||||
std::cout << "FATAL Error: System: "sv << ec.message() << std::endl;
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
proc_t(
|
||||
boost::process::environment &&env,
|
||||
std::vector<ctx_t> &&apps) :
|
||||
_app_id(-1),
|
||||
_env(std::move(env)),
|
||||
_apps(std::move(apps)) {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user