[cairo-commit] src/cairo-xlib-display.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Apr 23 12:15:57 PDT 2010
src/cairo-xlib-display.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
New commits:
commit 887d43578c3acc7d45c8b2e3ade5da29be804eeb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Apr 23 20:14:03 2010 +0100
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.
diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index be65c22..b0a5828 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -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);
-
- /* catch any that arrived before marking the display as closed */
- _cairo_xlib_display_notify (display);
- cairo_device_release (&display->base);
+ 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);
+ }
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 */
More information about the cairo-commit
mailing list