General: Fix Stop function

This commit is contained in:
Fernando Sahmkow 2020-03-11 20:44:53 -04:00
commit cb974be3ce

View file

@ -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;
}