From 030ac7e90714177119da72528f7397d506cf8cdf Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Dec 18 2012 18:17:52 +0000 Subject: 0001-xlib-shm-Fix-memory-leak.patch: Fix a memory leak with shm image surfaces. (#882976) --- diff --git a/0001-xlib-shm-Fix-memory-leak.patch b/0001-xlib-shm-Fix-memory-leak.patch new file mode 100644 index 0000000..0b0caf5 --- /dev/null +++ b/0001-xlib-shm-Fix-memory-leak.patch @@ -0,0 +1,29 @@ +From 84338157ab9e06fa89785af14772e046e2f9e747 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 18 Dec 2012 12:49:19 -0500 +Subject: [PATCH] xlib/shm: Fix memory leak + +Despite subclassing image surfaces, we never called down to the image +surface destructor, so we leaked a pixman_image_t every time. + +Signed-off-by: Adam Jackson +--- + src/cairo-xlib-surface-shm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c +index b03dd83..684d7e8 100644 +--- a/src/cairo-xlib-surface-shm.c ++++ b/src/cairo-xlib-surface-shm.c +@@ -679,7 +679,7 @@ _cairo_xlib_shm_surface_finish (void *abstract_surface) + cairo_list_del (&shm->link); + + cairo_device_release (&display->base); +- return CAIRO_STATUS_SUCCESS; ++ return _cairo_image_surface_finish (abstract_surface); + } + + static const cairo_surface_backend_t cairo_xlib_shm_surface_backend = { +-- +1.8.0.1 + diff --git a/cairo.spec b/cairo.spec index 93f8fc3..648bd94 100644 --- a/cairo.spec +++ b/cairo.spec @@ -5,7 +5,7 @@ Summary: A 2D graphics library Name: cairo Version: 1.12.8 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://cairographics.org #VCS: git:git://git.freedesktop.org/git/cairo #Source0: http://cairographics.org/snapshots/%{name}-%{version}.tar.gz @@ -15,6 +15,7 @@ Group: System Environment/Libraries Patch0: 0001-xlib-Don-t-crash-when-swapping-a-0-sized-glyph.patch Patch1: 0002-xcb-Don-t-crash-when-swapping-a-0-sized-glyph.patch +Patch2: 0001-xlib-shm-Fix-memory-leak.patch BuildRequires: pkgconfig BuildRequires: libXrender-devel @@ -94,6 +95,7 @@ This package contains tools for working with the cairo graphics library. %setup -q %patch0 -p1 -b .xlib-swap %patch1 -p1 -b .xcb-swap +%patch2 -p1 -b .shm-leak %build %configure --disable-static \ @@ -177,6 +179,10 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la %{_libdir}/cairo/ %changelog +* Tue Dec 18 2012 Adam Jackson 1.12.8-2 +- 0001-xlib-shm-Fix-memory-leak.patch: Fix a memory leak with shm image + surfaces. (#882976) + * Mon Nov 5 2012 Matthias Clasen - 1.12.8-1 - Update to 1.12.8, including a fix for screenshots in fallback mode