From 8200995fdbf04b2763d33cd30d7c8174eebc1736 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Sat, 20 Oct 2018 15:47:50 +0200
Subject: [PATCH 2/2] shaped-texture: Clean up texture regions

We allocated texture regions, but didn't free them when finished,
causing a leak.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/653
---
 src/compositor/meta-shaped-texture.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 5328a919ea..cd151a28ed 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -516,6 +516,7 @@ meta_shaped_texture_paint (ClutterActor *actor)
     }
   else
     {
+      opaque_tex_region = NULL;
       use_opaque_region = FALSE;
     }
 
@@ -659,6 +660,8 @@ meta_shaped_texture_paint (ClutterActor *actor)
         }
     }
 
+  g_clear_pointer (&clip_tex_region, cairo_region_destroy);
+  g_clear_pointer (&opaque_tex_region, cairo_region_destroy);
   g_clear_pointer (&blended_tex_region, cairo_region_destroy);
 }
 
-- 
2.19.1

