Browse Source

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.
pixls 9 months ago
parent
commit
4e3f35ccbf
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/video/SDL_pixels.c

+ 1 - 0
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;
     }