os2: SDL_DestroyMutex should ignore NULL mutexes.

Every other backend does this, so this should match, now.
It's possible this was harmless, but we can avoid the system call
and the (likely?) debug message when it fails, though!
main
Ryan C. Gordon 2022-04-20 14:07:30 -04:00
parent a40405d724
commit d4a01bfef0
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 5 additions and 5 deletions

View File

@ -56,12 +56,12 @@ SDL_CreateMutex(void)
void void
SDL_DestroyMutex(SDL_mutex * mutex) SDL_DestroyMutex(SDL_mutex * mutex)
{ {
ULONG ulRC;
HMTX hMtx = (HMTX)mutex; HMTX hMtx = (HMTX)mutex;
if (hMtx != NULLHANDLE) {
ulRC = DosCloseMutexSem(hMtx); const ULONG ulRC = DosCloseMutexSem(hMtx);
if (ulRC != NO_ERROR) { if (ulRC != NO_ERROR) {
debug_os2("DosCloseMutexSem(), rc = %u", ulRC); debug_os2("DosCloseMutexSem(), rc = %u", ulRC);
}
} }
} }