From 94f41dafd925ab2ff0dbbd3a7d47968d8ad12ffe Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Fri, 4 Mar 2022 19:02:25 -0500 Subject: Fix memory leak when using image tile mode cairo_pattern_t and cairo_surface_t are both reference counted; before this change, `pattern` being leaked kept alive an extra reference to the image to which it referred, thereby leaking the image as well. --- background-image.c | 1 + 1 file changed, 1 insertion(+) diff --git a/background-image.c b/background-image.c index 26cb6ee..53d1b63 100644 --- a/background-image.c +++ b/background-image.c @@ -108,6 +108,7 @@ void render_background_image(cairo_t *cairo, cairo_surface_t *image, cairo_pattern_t *pattern = cairo_pattern_create_for_surface(image); cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); cairo_set_source(cairo, pattern); + cairo_pattern_destroy(pattern); break; } case BACKGROUND_MODE_SOLID_COLOR: -- cgit v1.2.3