[gnome-control-center/gnome-3-34] Chain up to parent finalize()
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-34] Chain up to parent finalize()
- Date: Mon, 14 Oct 2019 20:14:35 +0000 (UTC)
commit a53cf1462104ad50949b39600b72324f0cc2dad4
Author: Niels De Graef <nielsdegraef gmail com>
Date: Mon Oct 14 09:55:04 2019 +0200
Chain up to parent finalize()
This was forgotten in a few places, which means you have a memory leak
(albeit tiny).
panels/background/cc-background-xml.c | 2 ++
panels/user-accounts/cc-crop-area.c | 17 +++++------------
2 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/panels/background/cc-background-xml.c b/panels/background/cc-background-xml.c
index 3caba6f8c..9b69e6967 100644
--- a/panels/background/cc-background-xml.c
+++ b/panels/background/cc-background-xml.c
@@ -612,6 +612,8 @@ cc_background_xml_finalize (GObject *object)
xml->item_added_id = 0;
}
g_clear_pointer (&xml->item_added_queue, g_async_queue_unref);
+
+ G_OBJECT_CLASS (cc_background_xml_parent_class)->finalize (object);
}
static void
diff --git a/panels/user-accounts/cc-crop-area.c b/panels/user-accounts/cc-crop-area.c
index 2bc327ba6..c4a04a630 100644
--- a/panels/user-accounts/cc-crop-area.c
+++ b/panels/user-accounts/cc-crop-area.c
@@ -694,18 +694,11 @@ cc_crop_area_finalize (GObject *object)
{
CcCropArea *area = CC_CROP_AREA (object);
- if (area->browse_pixbuf) {
- g_object_unref (area->browse_pixbuf);
- area->browse_pixbuf = NULL;
- }
- if (area->pixbuf) {
- g_object_unref (area->pixbuf);
- area->pixbuf = NULL;
- }
- if (area->color_shifted) {
- g_object_unref (area->color_shifted);
- area->color_shifted = NULL;
- }
+ g_clear_object (&area->browse_pixbuf);
+ g_clear_object (&area->pixbuf);
+ g_clear_object (&area->color_shifted);
+
+ G_OBJECT_CLASS (cc_crop_area_parent_class)->finalize (object);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]