From a564288864e0edac4c0ef42d8e4d37b88de602ad Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 20 Sep 2009 22:26:59 +0000 Subject: [PATCH] gtk intf: TGtkWidgetSet.CreateBitmap: gdk_pixbuf_render_pixmap_and_mask creates the pixmap and mask itself git-svn-id: trunk@21791 - --- lcl/interfaces/gtk/gtkwinapi.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 97614e33bb..c8d8fae00b 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -844,7 +844,18 @@ var gdk_pixbuf_loader_close(Loader {$ifdef gtk2},nil {$endif}); end; - gdk_pixbuf_render_pixmap_and_mask(Src, GdiObject^.GDIPixmapObject.Image, GdiObject^.GDIPixmapObject.Mask, $80); + if GdiObject^.GDIPixmapObject.Image<>nil then + begin + gdk_pixmap_unref(GdiObject^.GDIPixmapObject.Image); + GdiObject^.GDIPixmapObject.Image:=nil; + end; + if GdiObject^.GDIPixmapObject.Mask<>nil then + begin + gdk_bitmap_unref(GdiObject^.GDIPixmapObject.Mask); + GdiObject^.GDIPixmapObject.Mask:=nil; + end; + gdk_pixbuf_render_pixmap_and_mask(Src, + GdiObject^.GDIPixmapObject.Image, GdiObject^.GDIPixmapObject.Mask, $80); gdk_pixbuf_unref(Src); GdiObject^.Depth := gdk_drawable_get_depth(GdiObject^.GDIPixmapObject.Image);