Skip to content

Commit

Permalink
Merge pull request #4211 from asahilina/pthread-attr-memleak
Browse files Browse the repository at this point in the history
Threads: Fix memory leak in joinable()
  • Loading branch information
Sonicadvance1 authored Dec 12, 2024
2 parents e88c92d + 48ed906 commit f906c6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Tools/LinuxEmulation/LinuxSyscalls/Utils/Threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ namespace PThreads {
int AttachState {};
if (pthread_attr_getdetachstate(&Attr, &AttachState) == 0) {
if (AttachState == PTHREAD_CREATE_JOINABLE) {
pthread_attr_destroy(&Attr);
return true;
}
}
pthread_attr_destroy(&Attr);
}
return false;
}
Expand Down

0 comments on commit f906c6a

Please sign in to comment.