mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-13 22:10:39 +01:00
xlib: Simply release the ref, not destroy, from CloseDisplay.
Do not call the destroy function directly, but rely on the reference counting to call the notifier upon the last reference. Instead, simply release the reference we were holding for the cache and CloseDisplay callback.
This commit is contained in:
parent
c63e3490a5
commit
887d43578c
1 changed files with 11 additions and 9 deletions
|
|
@ -205,15 +205,15 @@ _cairo_xlib_close_display (Display *dpy, XExtCodes *codes)
|
|||
XSync (dpy, False);
|
||||
old_handler = XSetErrorHandler (_noop_error_handler);
|
||||
|
||||
if (cairo_device_acquire (&display->base))
|
||||
return 0;
|
||||
_cairo_xlib_display_notify (display);
|
||||
_cairo_xlib_call_close_display_hooks (display);
|
||||
_cairo_xlib_display_discard_screens (display);
|
||||
if (cairo_device_acquire (&display->base)) {
|
||||
_cairo_xlib_display_notify (display);
|
||||
_cairo_xlib_call_close_display_hooks (display);
|
||||
_cairo_xlib_display_discard_screens (display);
|
||||
|
||||
/* catch any that arrived before marking the display as closed */
|
||||
_cairo_xlib_display_notify (display);
|
||||
cairo_device_release (&display->base);
|
||||
/* catch any that arrived before marking the display as closed */
|
||||
_cairo_xlib_display_notify (display);
|
||||
cairo_device_release (&display->base);
|
||||
}
|
||||
|
||||
XSync (dpy, False);
|
||||
XSetErrorHandler (old_handler);
|
||||
|
|
@ -234,7 +234,9 @@ _cairo_xlib_close_display (Display *dpy, XExtCodes *codes)
|
|||
CAIRO_MUTEX_UNLOCK (_cairo_xlib_display_mutex);
|
||||
|
||||
assert (display != NULL);
|
||||
_cairo_xlib_display_destroy (display);
|
||||
|
||||
cairo_device_finish (&display->base);
|
||||
cairo_device_destroy (&display->base);
|
||||
|
||||
/* Return value in accordance with requirements of
|
||||
* XESetCloseDisplay */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue