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 - SDL_UnlockMutex(SDL_EventQ.lock) in SDL_PeepEvents can cause error when lock is null
Summary: SDL_UnlockMutex(SDL_EventQ.lock) in SDL_PeepEvents can cause error when lock ...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-18 20:25 UTC by Ghassan Al-Mashareqa
Modified: 2016-10-08 00:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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