mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
(cherry picked from commit 1a33c1b2b8)
This commit is contained in:
parent
6095a17534
commit
69d8a25d42
1 changed files with 7 additions and 0 deletions
|
|
@ -135,6 +135,7 @@ release_drawable(struct apple_glx_drawable *d)
|
||||||
static bool
|
static bool
|
||||||
destroy_drawable(struct apple_glx_drawable *d)
|
destroy_drawable(struct apple_glx_drawable *d)
|
||||||
{
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
d->lock(d);
|
d->lock(d);
|
||||||
|
|
||||||
|
|
@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d)
|
||||||
|
|
||||||
apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) 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);
|
free(d);
|
||||||
|
|
||||||
/* So that the locks are balanced and the caller correctly unlocks. */
|
/* So that the locks are balanced and the caller correctly unlocks. */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue