diff options
author | Uli Schlachter <psychon@znc.in> | 2011-07-08 16:51:19 +0200 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2011-07-09 09:42:22 +0200 |
commit | 4153de46892b47b5b21fbef8939ef732935bfe03 (patch) | |
tree | dd7fe4f15c0d81db90c90e36b30d9dbf5347814b /src/cairo-xcb-private.h | |
parent | e775db35d9306b74867f981a08d253562b15cffd (diff) | |
download | cairo-4153de46892b47b5b21fbef8939ef732935bfe03.tar.gz |
xcb: Track cairo_xcb_picture_t surfaces
When e.g. using an image surface as the source for a xcb surface, a
cairo_xcb_picture_t is created and attached to that image surface as a snapshot.
This contains the Picture that was created on the X11 server.
However, as soon as the cairo_xcb_picture_t's cairo_xcb_screen_t is finished and
destroyed, this picture can't be used anymore. This commit now makes sure all
these Pictures are freed when the screen is finished.
This was found because my X server's memory usage grew quite large. Every time
the app was done drawing, it destroyed its last surface which also destroyed the
last reference to the cairo_xcb_screen_t. This meant that the existing Picture
snapshots couldn't be used anymore, but they were still kept around and used up
memory until there wasn't any free memory left.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-xcb-private.h')
-rw-r--r-- | src/cairo-xcb-private.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cairo-xcb-private.h b/src/cairo-xcb-private.h index 82e05c3cf..3f085e0d8 100644 --- a/src/cairo-xcb-private.h +++ b/src/cairo-xcb-private.h @@ -123,6 +123,8 @@ struct _cairo_xcb_picture { int x0, y0; int x, y; + + cairo_list_t link; }; #if CAIRO_HAS_XLIB_XCB_FUNCTIONS @@ -189,6 +191,7 @@ struct _cairo_xcb_screen { cairo_list_t link; cairo_list_t surfaces; + cairo_list_t pictures; }; struct _cairo_xcb_connection { |