From 4e3f35ccbf57c827ab61df0d495e4354030a7b07 Mon Sep 17 00:00:00 2001 From: pixls <135275767+pixls@users.noreply.github.com> Date: Sat, 13 Jul 2024 23:53:29 +0100 Subject: [PATCH] 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. --- src/video/SDL_pixels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index f692bf6fde..79b0eade3a 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -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; }