[gjs] cairo: Free popped pattern



commit de56385227f178acac04ec96b5adefa1199046b3
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 7d6263b..d3e81f4 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -718,8 +718,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]