summaryrefslogtreecommitdiff
path: root/test/surface-source.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-09-29 15:28:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-09-29 15:33:09 +0100
commit41c66a9dfa9f4e7b9839db9dc362f5fa48797561 (patch)
tree2a176e1604d81096a1a712f2300968c232d0e62f /test/surface-source.c
parent63ee963c63a73cf6d9272e15a7d8f7b63f12e77b (diff)
downloadcairo-41c66a9dfa9f4e7b9839db9dc362f5fa48797561.tar.gz
[test/xlib-surface-source] Fix ill-timed XCloseDisplay
Sigh - finding a crasher in xlib seemed too good to be true. And it was. The bug is due to the coupling of the XCloseDisplay with the user_data on the source surface. This was an externally trigger XCloseDisplay whilst the user had live surfaces, so I consider this a gross application bug and therefore does not require graceful handling within cairo-xlib. However, I'm willing to listen to reason...
Diffstat (limited to 'test/surface-source.c')
-rw-r--r--test/surface-source.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/surface-source.c b/test/surface-source.c
index 98043761a..63b77a763 100644
--- a/test/surface-source.c
+++ b/test/surface-source.c
@@ -101,7 +101,6 @@ draw (cairo_t *cr, int width, int height)
cairo_set_source_surface (cr2, surface,
(INTER_SIZE - SOURCE_SIZE)/2,
(INTER_SIZE - SOURCE_SIZE)/2);
- cairo_surface_destroy (surface);
cairo_paint (cr2);
/* and then paint onto a small surface for checking */
@@ -112,6 +111,9 @@ draw (cairo_t *cr, int width, int height)
cairo_rectangle (cr, 15, 15, 60, 60);
cairo_fill (cr);
+ /* destroy the surface last, as this triggers XCloseDisplay */
+ cairo_surface_destroy (surface);
+
return CAIRO_TEST_SUCCESS;
}