diff options
author | Andrea Canciani <ranma42@gmail.com> | 2009-11-04 16:15:48 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-05 10:11:56 +0000 |
commit | d51915f873da8d40740a908c86f02e972e358be9 (patch) | |
tree | 9ab2f00a328fc690b46aa49b219917472cad04b1 /src | |
parent | 7c1424a315b677ca119d11b7ced1d4c969dde568 (diff) |
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')
-rw-r--r-- | src/cairo-xlib-screen.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cairo-xlib-screen.c b/src/cairo-xlib-screen.c index 8e29475b..09a2a810 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++) { |