Unlocking mutex in success case too

Without unlocking, we trigger an assertion failure in SDL_sysmutex.c at line 80 (i.e. 'rc == 0'). Each lock-unlock pair should ideally cancel each other out, maintaining a reference count that returns to zero.
This commit is contained in:
pixls 2024-07-13 23:53:29 +01:00 committed by Sam Lantinga
parent 2596482c3f
commit 4e3f35ccbf

View File

@ -661,6 +661,7 @@ const SDL_PixelFormatDetails *SDL_GetPixelFormatDetails(SDL_PixelFormat format)
}
if (SDL_FindInHashTable(SDL_format_details, (const void *)(uintptr_t)format, (const void **)&details)) {
SDL_UnlockMutex(SDL_format_details_lock);
return details;
}