diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-xlib-surface-shm.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c index a863a3672..08169f21a 100644 --- a/src/cairo-xlib-surface-shm.c +++ b/src/cairo-xlib-surface-shm.c @@ -82,6 +82,7 @@ struct _cairo_xlib_shm_info { struct _cairo_xlib_shm_surface { cairo_image_surface_t image; + cairo_list_t link; cairo_xlib_shm_info_t *info; Pixmap pixmap; unsigned long active; @@ -109,6 +110,8 @@ struct _cairo_xlib_shm_display { Window window; + cairo_list_t surfaces; + cairo_list_t pool; struct pqueue info; }; @@ -573,6 +576,8 @@ _cairo_xlib_shm_surface_finish (void *abstract_surface) _cairo_xlib_shm_pool_cleanup (display); } + cairo_list_del (&shm->link); + cairo_device_release (&display->base); return CAIRO_STATUS_SUCCESS; } @@ -682,6 +687,8 @@ _cairo_xlib_shm_surface_create (cairo_xlib_surface_t *other, assert (shm->active == 0 || will_sync); + cairo_list_add (&shm->link, &display->shm->surfaces); + cairo_device_release (&display->base); return shm; @@ -1153,6 +1160,8 @@ _cairo_xlib_display_init_shm (cairo_xlib_display_t *display) shm->opcode = codes ->major_opcode; shm->event = codes->first_event; + cairo_list_init (&shm->surfaces); + display->shm = shm; } @@ -1164,6 +1173,11 @@ _cairo_xlib_display_fini_shm (cairo_xlib_display_t *display) if (shm == NULL) return; + while (!cairo_list_is_empty (&shm->surfaces)) + cairo_surface_finish (&cairo_list_first_entry (&shm->surfaces, + cairo_xlib_shm_surface_t, + link)->image.base); + _pqueue_fini (&shm->info); while (!cairo_list_is_empty (&shm->pool)) { |