mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-22 12:40:11 +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) {
|
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()) {
|
if(app_id >= _apps.size()) {
|
||||||
std::cout << "Error: Couldn't find app with ID ["sv << app_id << ']' << std::endl;
|
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
|
// Ensure child process is terminated
|
||||||
process_end(_process, _process_handle);
|
process_end(_process, _process_handle);
|
||||||
|
_app_id = -1;
|
||||||
|
|
||||||
if(ec) {
|
if(ec) {
|
||||||
std::cout << "FATAL Error: System: "sv << ec.message() << std::endl;
|
std::cout << "FATAL Error: System: "sv << ec.message() << std::endl;
|
||||||
|
@ -49,6 +49,7 @@ public:
|
|||||||
proc_t(
|
proc_t(
|
||||||
boost::process::environment &&env,
|
boost::process::environment &&env,
|
||||||
std::vector<ctx_t> &&apps) :
|
std::vector<ctx_t> &&apps) :
|
||||||
|
_app_id(-1),
|
||||||
_env(std::move(env)),
|
_env(std::move(env)),
|
||||||
_apps(std::move(apps)) {}
|
_apps(std::move(apps)) {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user