We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3022

Summary: SDL_UnlockMutex(SDL_EventQ.lock) in SDL_PeepEvents can cause error when lock is null
Product: SDL Reporter: Ghassan Al-Mashareqa <kronikarz>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: All   

Description Ghassan Al-Mashareqa 2015-06-18 20:25:53 UTC
In general the SDL_EventQ.lock is handled a little bit differently wherever it shows up, sometimes it is checked for null, sometimes not, sometimes (like in SDL_PeepEvents) only when locking.

SDL_PeepEvents: 
    if (!SDL_EventQ.lock || SDL_LockMutex(SDL_EventQ.lock) == 0) {

SDL_FlushEvents:
    if (SDL_LockMutex(SDL_EventQ.lock) == 0) {

SDL_FilterEvents:
    if (SDL_EventQ.lock && SDL_LockMutex(SDL_EventQ.lock) == 0) {
Comment 1 Sam Lantinga 2016-10-08 00:58:18 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/3e61babccbbe