projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a311b1
)
darwin: Eliminate a pthread mutex leak
author
Jeremy Huddleston
<jeremyhu@apple.com>
Mon, 23 Apr 2012 23:43:22 +0000
(16:43 -0700)
committer
Jeremy Huddleston
<jeremyhu@apple.com>
Tue, 24 Apr 2012 07:26:48 +0000
(
00:26
-0700)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
src/glx/apple/apple_glx_drawable.c
patch
|
blob
|
history
diff --git
a/src/glx/apple/apple_glx_drawable.c
b/src/glx/apple/apple_glx_drawable.c
index 55302243358a2ebbcf2f21655dc4f7a3e3463407..db283023a63bfcc56ae85f48e160cda94943f814 100644
(file)
--- 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. */