diff options
author | Colomban Wendling <[email protected]> | 2024-06-18 15:36:25 +0200 |
---|---|---|
committer | lukefromdc <[email protected]> | 2024-06-18 14:46:03 -0400 |
commit | ef970c587da92f572a7af79de50c0cc4179400ba (patch) | |
tree | e6e009dbf0f26c2b029ff12adee438a1a0288578 /applets | |
parent | c1ee68665e937a380422e05fb1f10b77aaa1f3e7 (diff) | |
download | mate-panel-ef970c587da92f572a7af79de50c0cc4179400ba.tar.bz2 mate-panel-ef970c587da92f572a7af79de50c0cc4179400ba.tar.xz |
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 #1444.
[^1]: See commit e5c8646d8f6167fe2d3634a4604a1bf9ec8ee5af
Diffstat (limited to 'applets')
-rw-r--r-- | applets/notification_area/status-notifier/sn-item-v0.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/applets/notification_area/status-notifier/sn-item-v0.c b/applets/notification_area/status-notifier/sn-item-v0.c index 9deab9d3..9e66f361 100644 --- a/applets/notification_area/status-notifier/sn-item-v0.c +++ b/applets/notification_area/status-notifier/sn-item-v0.c @@ -287,7 +287,12 @@ update (SnItemV0 *v0) if (pixbuf && icon_size > 1) { /*An icon specified by path and filename may be the wrong size for the tray */ - pixbuf = gdk_pixbuf_scale_simple (pixbuf, icon_size-2, icon_size-2, GDK_INTERP_BILINEAR); + GdkPixbuf *scaled_pixbuf; + + scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, icon_size-2, icon_size-2, GDK_INTERP_BILINEAR); + g_object_unref (pixbuf); + pixbuf = scaled_pixbuf; + surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, NULL); } if (pixbuf) |