summaryrefslogtreecommitdiff
path: root/src/cairo-xlib-screen.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2009-11-04 16:15:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-11-05 10:11:56 +0000
commitd51915f873da8d40740a908c86f02e972e358be9 (patch)
tree9ab2f00a328fc690b46aa49b219917472cad04b1 /src/cairo-xlib-screen.c
parent7c1424a315b677ca119d11b7ced1d4c969dde568 (diff)
downloadcairo-d51915f873da8d40740a908c86f02e972e358be9.tar.gz
xlib: Fix double free
Both _cairo_xlib_call_close_display_hooks and _cairo_xlib_screen_destroy invoke _cairo_xlib_screen_close_display, which frees all the cached GCs, but (if HAS_ATOMIC_OPS is undefined) doesn't mark them as freed, thus freeing them agin upon the second invocation.
Diffstat (limited to 'src/cairo-xlib-screen.c')
-rw-r--r--src/cairo-xlib-screen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cairo-xlib-screen.c b/src/cairo-xlib-screen.c
index 8e29475b7..09a2a8107 100644
--- a/src/cairo-xlib-screen.c
+++ b/src/cairo-xlib-screen.c
@@ -282,6 +282,7 @@ _cairo_xlib_screen_close_display (cairo_xlib_screen_t *info)
} while (_cairo_atomic_int_cmpxchg (&info->gc_depths, old, 0) != old);
#else
old = info->gc_depths;
+ info->gc_depths = 0;
#endif
for (i = 0; i < ARRAY_LENGTH (info->gc); i++) {