diff --git a/src/process.cpp b/src/process.cpp index 1c78ff4d9c8..3a42a498147 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -362,6 +362,10 @@ namespace proc { proc_t::get_apps() { return _apps; } + void + proc_t::set_apps(std::vector apps) { + _apps = std::move(apps); + } // Gets application image from application list. // Returns image from assets directory if found there. @@ -382,6 +386,19 @@ namespace proc { return _app.name; } + const boost::process::v1::environment & + proc_t::get_env() const { + return _env; + } + boost::process::v1::environment & + proc_t::get_env() { + return _env; + } + void + proc_t::set_env(boost::process::v1::environment env) { + _env = std::move(env); + } + proc_t::~proc_t() { // It's not safe to call terminate() here because our proc_t is a static variable // that may be destroyed after the Boost loggers have been destroyed. Instead, @@ -716,7 +733,8 @@ namespace proc { auto proc_opt = proc::parse(file_name); if (proc_opt) { - proc = std::move(*proc_opt); + proc.set_env(proc_opt->get_env()); + proc.set_apps(proc_opt->get_apps()); } } } // namespace proc diff --git a/src/process.h b/src/process.h index 2b0ba8b9002..f2844e60ba2 100644 --- a/src/process.h +++ b/src/process.h @@ -89,10 +89,18 @@ namespace proc { get_apps() const; std::vector & get_apps(); + void + set_apps(std::vector apps); std::string get_app_image(int app_id); std::string get_last_run_app_name(); + const boost::process::v1::environment & + get_env() const; + boost::process::v1::environment & + get_env(); + void + set_env(boost::process::v1::environment env); void terminate();