mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Don't crash if something goes wrong with mutexes.
Probably can't happen but being defensive is good.
This commit is contained in:
parent
b71d998a20
commit
db16f9309e
1 changed files with 3 additions and 1 deletions
|
@ -121,6 +121,7 @@ void __KernelMutexInit()
|
|||
|
||||
void __KernelMutexAcquireLock(Mutex *mutex, int count, SceUID thread)
|
||||
{
|
||||
_dbg_assert_msg_(HLE, mutexHeldLocks.find(threadID) == mutexHeldLocks.end(), "Thread %d wasn't removed from mutexHeldLocks properly.");
|
||||
mutexHeldLocks.insert(std::make_pair(thread, mutex->GetUID()));
|
||||
|
||||
mutex->nm.lockLevel = count;
|
||||
|
@ -328,7 +329,8 @@ void __KernelMutexThreadEnd(SceUID threadID)
|
|||
SceUID mutexID = (*iter).second;
|
||||
Mutex *mutex = kernelObjects.Get<Mutex>(mutexID, error);
|
||||
|
||||
__KernelUnlockMutex(mutex, error);
|
||||
if (mutex)
|
||||
__KernelUnlockMutex(mutex, error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue