}
}
-/* Return true if an error occured. */
+/* Return true if an error occurred. */
static bool
create_surface(Display * dpy, int screen, struct apple_glx_drawable *d)
{
return true; /* unable to create a surface. */
}
-/* Return true if an error occured. */
+/* Return true if an error occurred. */
/* This returns a referenced object via resultptr. */
bool
apple_glx_surface_create(Display * dpy, int screen,
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
* 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);
+ }
}
}