diff options
Diffstat (limited to 'zencore/thread.cpp')
| -rw-r--r-- | zencore/thread.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp index ff86ff5fc..60bd73994 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -300,6 +300,12 @@ void ProcessHandle::Initialize(void* ProcessHandle) { ZEN_ASSERT(m_ProcessHandle == nullptr); + + if (ProcessHandle == INVALID_HANDLE_VALUE) + { + ProcessHandle = nullptr; + } + // TODO: perform some debug verification here to verify it's a valid handle? m_ProcessHandle = ProcessHandle; m_Pid = GetProcessId(m_ProcessHandle); @@ -338,7 +344,7 @@ ProcessHandle::IsRunning() const bool ProcessHandle::IsValid() const { - return (m_ProcessHandle != nullptr) && (m_ProcessHandle != INVALID_HANDLE_VALUE); + return (m_ProcessHandle != nullptr); } void |