summaryrefslogtreecommitdiff
path: root/applets/notification_area
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2024-06-18 15:36:25 +0200
committerLuke from DC <[email protected]>2024-06-18 18:44:31 +0000
commit1de955b0b3a80cbc1bd840bad312f8ad3f0ae99b (patch)
tree1ab921b3fc494ff633cb62dd9e828f680d9df43a /applets/notification_area
parente182420b844fab9ed3c08c734712fb41f424200b (diff)
downloadmate-panel-1de955b0b3a80cbc1bd840bad312f8ad3f0ae99b.tar.bz2
mate-panel-1de955b0b3a80cbc1bd840bad312f8ad3f0ae99b.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/notification_area')
-rw-r--r--applets/notification_area/status-notifier/sn-item-v0.c7
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)