[gjs/gnome-3-24] cairo: Free popped pattern



commit 35229966d1f9f6e4087061bc496e45b3d56326f0
Author: Philip Chimento <philip endlessm com>
Date:   Thu Aug 31 15:46:47 2017 -0700

    cairo: Free popped pattern
    
    This pattern was leaked; according to the documentation the caller owns
    the return value of cairo_pop_group().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786995

 modules/cairo-context.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/modules/cairo-context.cpp b/modules/cairo-context.cpp
index d18d74d..4b74658 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -712,8 +712,8 @@ popGroup_func(JSContext *context,
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
         return false;
 
-    /* pattern belongs to the context, so keep the reference */
     pattern_wrapper = gjs_cairo_pattern_from_pattern(context, pattern);
+    cairo_pattern_destroy(pattern);
     if (!pattern_wrapper) {
         gjs_throw(context, "failed to create pattern");
         return false;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]