summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2024-06-18 15:36:25 +0200
committerlukefromdc <[email protected]>2024-06-18 16:51:42 -0400
commitf2d9490cfe5542005bd57897955c0af72387f3ca (patch)
tree5e433971283a907e1808367c1c30823bf7701939
parent474d6ee766326b2418aed95b3cfd0c794f464e96 (diff)
downloadmate-panel-f2d9490cfe5542005bd57897955c0af72387f3ca.tar.bz2
mate-panel-f2d9490cfe5542005bd57897955c0af72387f3ca.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
-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 9a05a69f..5bc646f2 100644
--- a/applets/notification_area/status-notifier/sn-item-v0.c
+++ b/applets/notification_area/status-notifier/sn-item-v0.c
@@ -288,7 +288,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)