summaryrefslogtreecommitdiffstats
path: root/packaging/macos/modulesets/patches/cairo-snapshot_leak.patch
blob: 5780735e978ae4c5beea9e535909731095e6dc6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/316
From 243938c61a08dac8911153352e55933e0618581e Mon Sep 17 00:00:00 2001
From: John Ralls <jralls@ceridwen.us>
Date: Sat, 23 Apr 2022 16:38:01 -0700
Subject: [PATCH] [quartz] Destroy local copy of snapshot after attaching it.

Because cairo_surface_snapshot_attach refs the snapshot.

Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/562
---
 src/cairo-quartz-surface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 5681918c4..fa6d9b1c9 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -2609,6 +2609,7 @@ _cairo_quartz_surface_snapshot_get_image (cairo_quartz_surface_t *surface)
 	if (unlikely (!snapshot || cairo_surface_status (snapshot)))
 	    return NULL;
 	_cairo_surface_attach_snapshot (&surface->base, snapshot, NULL);
+	cairo_surface_destroy (snapshot);
     }
 
     return CGImageRetain (((cairo_quartz_snapshot_t*)snapshot)->image);
-- 
GitLab