diff options
| author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-03-11 20:44:53 -0400 |
|---|---|---|
| committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-27 11:35:47 -0400 |
| commit | cb974be3ce3de687f6c4f160ed5183f0de0958f5 (patch) | |
| tree | 488d71b9de2368944b99b0a188adb84826f1167a /src/core/hle/kernel/thread.cpp | |
| parent | 3869e55c2743c1e7152f54c279fac55814ed4139 (diff) | |
General: Fix Stop function
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 1c32552b12..6f8e7a070a 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -56,10 +56,12 @@ void Thread::Stop() { Signal(); kernel.GlobalHandleTable().Close(global_handle); - owner_process->UnregisterThread(this); + if (owner_process) { + owner_process->UnregisterThread(this); - // Mark the TLS slot in the thread's page as free. - owner_process->FreeTLSRegion(tls_address); + // Mark the TLS slot in the thread's page as free. + owner_process->FreeTLSRegion(tls_address); + } } global_handle = 0; } |
