[arch-commits] Commit in gnome-shell/trunk (2 files)

Ionut Biru ibiru at archlinux.org
Wed May 11 18:16:09 UTC 2011


    Date: Wednesday, May 11, 2011 @ 14:16:09
  Author: ibiru
Revision: 123600

properly fix the memory leak

Added:
  gnome-shell/trunk/st-private_correct_fix_memory_leak.patch
Modified:
  gnome-shell/trunk/PKGBUILD

------------------------------------------+
 PKGBUILD                                 |    5 ++
 st-private_correct_fix_memory_leak.patch |   52 +++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-05-11 17:35:02 UTC (rev 123599)
+++ PKGBUILD	2011-05-11 18:16:09 UTC (rev 123600)
@@ -4,7 +4,7 @@
 
 pkgname=gnome-shell
 pkgver=3.0.1
-pkgrel=4
+pkgrel=5
 pkgdesc="The next generation GNOME Shell"
 arch=('i686' 'x86_64')
 url="http://live.gnome.org/GnomeShell"
@@ -22,12 +22,14 @@
         network_fixes_up_to_5090a4ccce.patch
         shell-xfixes-cursor_missing_free.patch
         st-private_fix_memory_leak.patch
+        st-private_correct_fix_memory_leak.patch
         0001-Don-t-crash-when-removing-nameless-user.patch)
 sha256sums=('01f7ae942ba9687a5e67d62423843ed404d77b35f74acc212a5f391beed8e079'
             'a35d5e5f9f781728070aecae3bfe329f49dadcd50ca2984e0fbdd2219825a0db'
             '01bf41483d5d8935ed2dd6294ee04024f2d9bcb2ef13276b07331e485965c822'
             'c8b92768c869d0d77595da3466cc0dba3b6f067ea5fac048f32a918bbe98bbf6'
             '8b80a0cec39c38a47521183a3030a782ab84bb6ea5e9cc58213589245288e718'
+            'c676067fff399a87625187381db5331d82c44f6c14f51d409392851dbbeb5074'
             '291d1fa51344325e3dabc0c1287750cde98605c30f079ffad9b3523a3aba860d')
 
 build() {
@@ -37,6 +39,7 @@
   patch -Np1 -i "${srcdir}/network_fixes_up_to_5090a4ccce.patch"
   patch -Np1 -i "${srcdir}/shell-xfixes-cursor_missing_free.patch"
   patch -Np1 -i "${srcdir}/st-private_fix_memory_leak.patch"
+  patch -Np1 -i "${srcdir}/st-private_correct_fix_memory_leak.patch"
   patch -Np1 -i "${srcdir}/0001-Don-t-crash-when-removing-nameless-user.patch"
 
   ./configure --prefix=/usr --sysconfdir=/etc \

Added: st-private_correct_fix_memory_leak.patch
===================================================================
--- st-private_correct_fix_memory_leak.patch	                        (rev 0)
+++ st-private_correct_fix_memory_leak.patch	2011-05-11 18:16:09 UTC (rev 123600)
@@ -0,0 +1,52 @@
+From c975740f9228b2c53d79ac08ad704fca5f1c5b6e Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters at verbum.org>
+Date: Wed, 11 May 2011 15:21:18 +0000
+Subject: st-private: Correct fix for memory leak
+
+The previous fix in 72f9f482d was wrong; we need to keep around
+the buffer until cairo is done with the pattern.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=649497
+---
+diff --git a/src/st/st-private.c b/src/st/st-private.c
+index 51798a1..21ca09a 100644
+--- a/src/st/st-private.c
++++ b/src/st/st-private.c
+@@ -667,6 +667,7 @@ cairo_pattern_t *
+ _st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
+                                  cairo_pattern_t *src_pattern)
+ {
++  static cairo_user_data_key_t shadow_pattern_user_data;
+   cairo_t *cr;
+   cairo_surface_t *src_surface;
+   cairo_surface_t *surface_in;
+@@ -728,6 +729,8 @@ _st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
+                                                      width_out,
+                                                      height_out,
+                                                      rowstride_out);
++  cairo_surface_set_user_data (surface_out, &shadow_pattern_user_data,
++                               pixels_out, (cairo_destroy_func_t) g_free);
+ 
+   dst_pattern = cairo_pattern_create_for_surface (surface_out);
+   cairo_surface_destroy (surface_out);
+@@ -745,8 +748,7 @@ _st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
+                               (width_out - width_in) / 2.0,
+                               (height_out - height_in) / 2.0);
+       cairo_pattern_set_matrix (dst_pattern, &shadow_matrix);
+-
+-      goto out;
++      return dst_pattern;
+     }
+ 
+   /* Read all the code from the cairo_pattern_set_matrix call
+@@ -784,8 +786,6 @@ _st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
+ 
+   cairo_pattern_set_matrix (dst_pattern, &shadow_matrix);
+ 
+- out:
+-  g_free (pixels_out);
+   return dst_pattern;
+ }
+ 
+--
+cgit v0.9




More information about the arch-commits mailing list