From e73eb3ad3867ba6b4da280aa40d891722090ab93 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 4 Aug 2017 13:18:01 +0200 Subject: [PATCH] gears.surface.apply_shape_bounding: Finish temporary image This function draws the wanted shape to a cairo image surface and then uses it to set the shape of the passed-in object. After this commit, this temporary image is finished afterwards, making it free most of its memory immediately instead of only later when the garbage collector collects the image surface. Related-to: https://github.com/awesomeWM/awesome/issues/1958 Signed-off-by: Uli Schlachter --- lib/gears/surface.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gears/surface.lua b/lib/gears/surface.lua index 1edfcd19a..3bdd460c9 100644 --- a/lib/gears/surface.lua +++ b/lib/gears/surface.lua @@ -204,6 +204,7 @@ function surface.apply_shape_bounding(draw, shape, ...) cr:fill() draw.shape_bounding = img._native + img:finish() end local function no_op() end