summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Maebe <jonas.maebe@elis.ugent.be>2012-04-23 16:02:16 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-04-23 16:18:19 -0700
commit6095a17534c2694760300701fee59a320950f271 (patch)
tree757d94e28979ed0fb4bfb334d418b152eab357a0
parentbb30e76328e9dd80b0c7a7688828e3cf8e662b1b (diff)
apple: Fix a use after free
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> (cherry picked from commit c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34)
-rw-r--r--src/glx/apple/apple_glx_surface.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c
index 39f513034dc..d42fa3b3269 100644
--- a/src/glx/apple/apple_glx_surface.c
+++ b/src/glx/apple/apple_glx_surface.c
@@ -206,6 +206,10 @@ apple_glx_surface_destroy(unsigned int uid)
if (d) {
d->types.surface.pending_destroy = true;
d->release(d);
+
+ /* apple_glx_drawable_find_by_uid returns a locked drawable */
+ d->unlock(d);
+
/*
* We release 2 references to the surface. One was acquired by
* the find, and the other was leftover from a context, or
@@ -217,7 +221,5 @@ apple_glx_surface_destroy(unsigned int uid)
* by a glViewport callback (see apple_glx_context_update()).
*/
d->destroy(d);
-
- d->unlock(d);
}
}