diff options
author | Jeremy Huddleston <[email protected]> | 2012-04-23 16:43:22 -0700 |
---|---|---|
committer | Jeremy Huddleston <[email protected]> | 2012-04-24 00:26:48 -0700 |
commit | 1a33c1b2b895566299ec76643659adacc239a3dc (patch) | |
tree | eb808b020ee625fb487a8ac2c9fd2bb7e2b427d6 /src/glx/apple/apple_glx_drawable.c | |
parent | 2a311b18fce9ea6538b0997ad23d86a061fb273c (diff) |
darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <[email protected]>
Tested-by: Charles Davis <[email protected]>
Diffstat (limited to 'src/glx/apple/apple_glx_drawable.c')
-rw-r--r-- | src/glx/apple/apple_glx_drawable.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index 55302243358..db283023a63 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -135,6 +135,7 @@ release_drawable(struct apple_glx_drawable *d) static bool destroy_drawable(struct apple_glx_drawable *d) { + int err; d->lock(d); @@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d) apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d); + err = pthread_mutex_destroy(&d->mutex); + if (err) { + fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err)); + abort(); + } + free(d); /* So that the locks are balanced and the caller correctly unlocks. */ |