[gtk+/gtk-3-20] places sidebar: Plug a small memory leak
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-20] places sidebar: Plug a small memory leak
- Date: Sun, 27 Mar 2016 15:29:22 +0000 (UTC)
commit 8ff6d55c18ccd28957a7d6cd5f911ebd659e916a
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Mar 27 10:59:59 2016 -0400
places sidebar: Plug a small memory leak
_gtk_trash_moniotr_get_icon is transfer full, so we have
to unref the icon.
gtk/gtkplacessidebar.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 16d2ef2..ed3d643 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -893,8 +893,13 @@ static void
update_trash_icon (GtkPlacesSidebar *sidebar)
{
if (sidebar->trash_row)
- gtk_sidebar_row_set_icon (GTK_SIDEBAR_ROW (sidebar->trash_row),
- _gtk_trash_monitor_get_icon (sidebar->trash_monitor));
+ {
+ GIcon *icon;
+
+ icon = _gtk_trash_monitor_get_icon (sidebar->trash_monitor);
+ gtk_sidebar_row_set_icon (GTK_SIDEBAR_ROW (sidebar->trash_row), icon);
+ g_object_unref (icon);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]