diff options
author | Marcin Zawiejski <dragmz@gmail.com> | 2018-08-20 19:14:57 +0200 |
---|---|---|
committer | Marcin Zawiejski <dragmz@gmail.com> | 2018-08-20 22:41:06 +0200 |
commit | ca1c851dbdc14701695d9589225b44d5681606f0 (patch) | |
tree | 7a092ecc199a4e2a537eb9764cfeec92f39f0fa1 /drivers | |
parent | 1eb1606f34f0696eb5f1694a3fc563125ad914b8 (diff) |
Try closing gracefully before terminating process
Use a Microsoft recommended way of process termination for the project
process run from the editor. This allows loaded DLLs to receive and handle
DLL_PROCESS_DETACH notification and cleanup any global state before the
process actually exits.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/unix/os_unix.cpp | 2 | ||||
-rw-r--r-- | drivers/unix/os_unix.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 05dfd69f58..8aab4cb521 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -329,7 +329,7 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo return OK; } -Error OS_Unix::kill(const ProcessID &p_pid) { +Error OS_Unix::kill(const ProcessID &p_pid, const int p_max_wait_msec) { int ret = ::kill(p_pid, SIGKILL); if (!ret) { diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 95b74d23ff..c5240231fa 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -91,7 +91,7 @@ public: virtual uint64_t get_ticks_usec() const; virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false); - virtual Error kill(const ProcessID &p_pid); + virtual Error kill(const ProcessID &p_pid, const int p_max_wait_msec = -1); virtual int get_process_id() const; virtual bool has_environment(const String &p_var) const; |