#8 Memory leak in PThreadMutex.c++

open
nobody
None
5
2006-02-16
2006-02-16
No

Memory leak in PThreadMutex.c++
In the PThreadMutex.c++ there's a memory leak which can
easily be fixed.

The problem:
The Mutex constructor doesn't destroy mutexattr.

The fix is:
At the end of the constructor invoke:
pthread_mutexattr_destroy(&mutex_attr)

I have tested this. It solves the memory leak.

Discussion


Log in to post a comment.