[gtkmm/wip/dboles/Gdk_ImageSurface: 2/4] Window: Do not add 2nd ref to new Cairo::Surface



commit 265be45408d2b5a8ace4e091b8a6c36851eb635c
Author: Daniel Boles <dboles src gmail com>
Date:   Thu Jun 20 18:49:05 2019 +0100

    Window: Do not add 2nd ref to new Cairo::Surface
    
    The C functions already return a newly allocated objected that the
    caller owns, so if we pass `false` as Cairo's `has_reference`, then we
    add another on the gtkmm side, so we will end up leaking that object.
    
    https://gitlab.gnome.org/GNOME/gtkmm/merge_requests/19#note_535429

 gdk/src/window.hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index eb8e94d0..2162d805 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -253,7 +253,7 @@ public:
   _WRAP_METHOD(bool get_decorations(WMDecoration& decorations) const, gdk_window_get_decorations)
   _WRAP_METHOD(void set_functions(WMFunction functions), gdk_window_set_functions)
 
-  #m4 _CONVERSION(`cairo_surface_t*',`::Cairo::RefPtr< ::Cairo::Surface>',`::Cairo::RefPtr< 
::Cairo::Surface>(new ::Cairo::Surface($3, false /* take reference */))')
+  #m4 _CONVERSION(`cairo_surface_t*',`::Cairo::RefPtr< ::Cairo::Surface>',`::Cairo::RefPtr< 
::Cairo::Surface>(new ::Cairo::Surface($3, true /* do not take ref */))')
   #m4 _CONVERSION(`::Cairo::Content',`cairo_content_t',`(cairo_content_t)($3)')
   _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> create_similar_surface(::Cairo::Content content, int 
width,  int height), gdk_window_create_similar_surface )
 


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