[gnome-panel] status-notifier: fix memory leak
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] status-notifier: fix memory leak
- Date: Wed, 24 May 2017 09:38:54 +0000 (UTC)
commit 6f4b078da832fbaed2fa5156d2e46b70e9870a7c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed May 24 12:36:15 2017 +0300
status-notifier: fix memory leak
.../external/status-notifier/sn-image-menu-item.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/modules/external/status-notifier/sn-image-menu-item.c
b/modules/external/status-notifier/sn-image-menu-item.c
index 2246b96..90f16ed 100644
--- a/modules/external/status-notifier/sn-image-menu-item.c
+++ b/modules/external/status-notifier/sn-image-menu-item.c
@@ -35,6 +35,18 @@ struct _SnImageMenuItem
G_DEFINE_TYPE (SnImageMenuItem, sn_image_menu_item, GTK_TYPE_MENU_ITEM)
static void
+sn_image_menu_item_finalize (GObject *object)
+{
+ SnImageMenuItem *item;
+
+ item = SN_IMAGE_MENU_ITEM (object);
+
+ g_clear_pointer (&item->label, g_free);
+
+ G_OBJECT_CLASS (sn_image_menu_item_parent_class)->finalize (object);
+}
+
+static void
sn_image_menu_item_get_preferred_width (GtkWidget *widget,
gint *minimum,
gint *natural)
@@ -145,12 +157,16 @@ sn_image_menu_item_set_label (GtkMenuItem *menu_item,
static void
sn_image_menu_item_class_init (SnImageMenuItemClass *item_class)
{
+ GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkMenuItemClass *menu_item_class;
+ object_class = G_OBJECT_CLASS (item_class);
widget_class = GTK_WIDGET_CLASS (item_class);
menu_item_class = GTK_MENU_ITEM_CLASS (item_class);
+ object_class->finalize = sn_image_menu_item_finalize;
+
widget_class->get_preferred_width = sn_image_menu_item_get_preferred_width;
widget_class->size_allocate = sn_image_menu_item_size_allocate;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]