Skip to content

pthread: add call to pthread_mutexattr_destroy#14786

Merged
slouken merged 4 commits intolibsdl-org:mainfrom
limb-soup:main
Jan 7, 2026
Merged

pthread: add call to pthread_mutexattr_destroy#14786
slouken merged 4 commits intolibsdl-org:mainfrom
limb-soup:main

Conversation

@limb-soup
Copy link
Copy Markdown
Contributor

@limb-soup limb-soup commented Jan 7, 2026

Added a call to pthread_mutexattr_destroy to SDL_CreateMutex: necessary to free memory allocated from call to pthread_mutexattr_init.
see: https://pubs.opengroup.org/onlinepubs/9799919799/
After a mutex attributes object has been used to initialize one or more mutexes, any function affecting the attributes object (including destruction) shall not affect any previously initialized mutexes.

@limb-soup limb-soup changed the title pthread: Move attr inside mutex struct and fix memory leak pthread: add call to pthread_mutexattr_destroy Jan 7, 2026
Comment thread src/thread/pthread/SDL_sysmutex.c Outdated
@slouken slouken merged commit f805bb5 into libsdl-org:main Jan 7, 2026
45 checks passed
@slouken
Copy link
Copy Markdown
Collaborator

slouken commented Jan 7, 2026

Merged, thanks!

@slouken slouken added this to the 3.4.2 milestone Jan 7, 2026
slouken pushed a commit that referenced this pull request Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants