mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 20:10:24 +01:00
darwin: Eliminate a possible race condition while destroying a surface
Introduced by:c60ffd2840Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> (cherry picked from commitd65bd195ec)
This commit is contained in:
parent
7e624edba4
commit
9724c8d13c
1 changed files with 4 additions and 4 deletions
|
|
@ -207,9 +207,6 @@ apple_glx_surface_destroy(unsigned int uid)
|
|||
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
|
||||
|
|
@ -220,6 +217,9 @@ apple_glx_surface_destroy(unsigned int uid)
|
|||
* to actually destroy it when the pending_destroy is processed
|
||||
* by a glViewport callback (see apple_glx_context_update()).
|
||||
*/
|
||||
d->destroy(d);
|
||||
if (!d->destroy(d)) {
|
||||
/* apple_glx_drawable_find_by_uid returns a locked drawable */
|
||||
d->unlock(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue