[Commits] [SCM] claws branch, master, updated. 3.17.3-151-gd4d8239

ticho at claws-mail.org ticho at claws-mail.org
Mon Apr 22 13:07:53 CEST 2019


The branch, master has been updated
       via  d4d8239c2fb85aa79bb348cc62ee78a57f187136 (commit)
      from  cc60626486ae41a9bfd52e9ef1edbb2ab89d5539 (commit)

Summary of changes:
 src/stock_pixmap.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit d4d8239c2fb85aa79bb348cc62ee78a57f187136
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Mon Apr 22 13:06:19 2019 +0200

    Fix a memory leak in stock_pixmap_widget_with_overlay()

diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
index 181d4ca..44b278a 100644
--- a/src/stock_pixmap.c
+++ b/src/stock_pixmap.c
@@ -1077,6 +1077,8 @@ GtkWidget *stock_pixmap_widget_with_overlay(StockPixmap icon,
 			data->overlay_pixmap = NULL;
 		} else {
 			stock_wid = stock_pixmap_widget(overlay);
+			g_object_ref_sink(stock_wid);
+
 			cr = gdk_cairo_create(gtk_widget_get_window(stock_wid));
 			stock_pixmap = cairo_get_target(cr);
 			cairo_surface_reference(stock_pixmap);
@@ -1085,7 +1087,7 @@ GtkWidget *stock_pixmap_widget_with_overlay(StockPixmap icon,
 			data->overlay_height = requisition.height;
 			data->overlay_width  = requisition.width;
 
-			gtk_widget_destroy(stock_wid);
+			g_object_unref(stock_wid);
 		}
 	} else {
 		data->is_pixmap = FALSE;
@@ -1099,13 +1101,15 @@ GtkWidget *stock_pixmap_widget_with_overlay(StockPixmap icon,
 			data->overlay_pixmap = NULL;
 		} else {
 			stock_wid = stock_pixmap_widget(overlay);
+			g_object_ref_sink(stock_wid);
+
 			stock_pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(stock_wid));
 			g_object_ref(stock_pixbuf);
 			data->overlay_pixbuf = stock_pixbuf;
 			data->overlay_height = requisition.height;
 			data->overlay_width  = requisition.width;
 
-			gtk_widget_destroy(stock_wid);
+			g_object_unref(stock_wid);
 		}
 	}
 	data->position = pos;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list