[cairo-commit] src/cairo-xlib-display.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Aug 14 05:53:27 PDT 2011


 src/cairo-xlib-display.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit eb09a686388b889f67f3a9b2c820575a1cfbc304
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Aug 14 13:52:11 2011 +0100

    xlib: Move the Display pointer nullify into destroy from finish
    
    Oops, should have checked with more than just the one test before
    claiming victory.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index 59e602d..3acc893 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -177,8 +177,6 @@ _cairo_xlib_display_finish (void *abstract_display)
 
 	cairo_device_release (&display->base);
     }
-
-    display->display = NULL;
 }
 
 static void
@@ -237,8 +235,7 @@ _cairo_xlib_close_display (Display *dpy, XExtCodes *codes)
     }
     CAIRO_MUTEX_UNLOCK (_cairo_xlib_display_mutex);
 
-    assert (display != NULL);
-
+    display->display = NULL; /* catch any later invalid access */
     cairo_device_destroy (&display->base);
 
     /* Return value in accordance with requirements of


More information about the cairo-commit mailing list