Skip to content

Commit 1de955b

Browse files
cwendlinglukefromdc
authored andcommitted
status-notifier: Plug large leak with icons from paths
When loading an icon from a path rather than the icon theme, we scale it down to match the scale we need[^1], but we leaked the original pixbuf in this case. Fixes mate-desktop#1444. [^1]: See commit e5c8646
1 parent e182420 commit 1de955b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

applets/notification_area/status-notifier/sn-item-v0.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,12 @@ update (SnItemV0 *v0)
287287
if (pixbuf && icon_size > 1)
288288
{
289289
/*An icon specified by path and filename may be the wrong size for the tray */
290-
pixbuf = gdk_pixbuf_scale_simple (pixbuf, icon_size-2, icon_size-2, GDK_INTERP_BILINEAR);
290+
GdkPixbuf *scaled_pixbuf;
291+
292+
scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, icon_size-2, icon_size-2, GDK_INTERP_BILINEAR);
293+
g_object_unref (pixbuf);
294+
pixbuf = scaled_pixbuf;
295+
291296
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, NULL);
292297
}
293298
if (pixbuf)

0 commit comments

Comments
 (0)