>From 5c8eeb79b245180779eb3981b02a7cf5d9f1853d Mon Sep 17 00:00:00 2001
From: egag <ed44@xs4all.nl>
Date: Wed, 24 Apr 2013 12:07:47 +0200
Subject: [PATCH] Aquire display before using it in DEBUG message.

---
 src/cairo-xlib-surface.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 96ba3ad..dd6800e 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -385,14 +385,14 @@ _cairo_xlib_surface_finish (void *abstract_surface)
     cairo_status_t        status;
     cairo_xlib_display_t *display;
 
-    X_DEBUG ((display->display, "finish (drawable=%x)", (unsigned int) surface->drawable));
-
     cairo_list_del (&surface->link);
 
     status = _cairo_xlib_display_acquire (surface->base.device, &display);
     if (unlikely (status))
         return status;
 
+    X_DEBUG ((display->display, "finish (drawable=%x)", (unsigned int) surface->drawable));
+    
     if (surface->embedded_source.picture)
 	XRenderFreePicture (display->display, surface->embedded_source.picture);
     if (surface->picture)
-- 
1.7.4.4

