Skip to content

Conversation

@dhthwy
Copy link
Contributor

@dhthwy dhthwy commented Dec 6, 2024

… pthread_mutex_init() temporarily uses the attributes object for configuration but does not take any ownership.

There is a memory allocation performed by pthread_mutexattr_init().

Assuming luai_userstateopen() is only called once or rarely, this resolves a small resource leak.

… pthread_mutex_init() temporarily uses the attributes object for configuration but does not take ownership.
Copy link
Member

@ab9rf ab9rf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did verify that, per the spec:

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.

so this is safe

@myk002 myk002 merged commit 5b744e7 into DFHack:develop Dec 7, 2024
12 checks passed
@dhthwy dhthwy deleted the pr5061mem branch December 9, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants