[gnome-control-center/wip/benzea/display-settings-widget: 3/13] display: Add missing finalize handler for CcDisplayMonitor



commit 713e209783a14b31aaaeefeec87b5b26a0543f03
Author: Benjamin Berg <bberg redhat com>
Date:   Sun Jan 20 21:42:04 2019 +0100

    display: Add missing finalize handler for CcDisplayMonitor
    
    This caused the UI related strings to be leaked.

 panels/display/cc-display-config.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/panels/display/cc-display-config.c b/panels/display/cc-display-config.c
index e2b6d991c..626f3f5f4 100644
--- a/panels/display/cc-display-config.c
+++ b/panels/display/cc-display-config.c
@@ -150,9 +150,25 @@ cc_display_monitor_init (CcDisplayMonitor *self)
   priv->is_usable = TRUE;
 }
 
+static void
+cc_display_monitor_finalize (GObject *object)
+{
+  CcDisplayMonitor *self = CC_DISPLAY_MONITOR (object);
+  CcDisplayMonitorPrivate *priv = CC_DISPLAY_MONITOR_GET_PRIVATE (self);
+
+  g_clear_pointer (&priv->ui_name, g_free);
+  g_clear_pointer (&priv->ui_number_name, g_free);
+
+  G_OBJECT_CLASS (cc_display_monitor_parent_class)->finalize (object);
+}
+
 static void
 cc_display_monitor_class_init (CcDisplayMonitorClass *klass)
 {
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+  gobject_class->finalize = cc_display_monitor_finalize;
+
   g_signal_new ("rotation",
                 CC_TYPE_DISPLAY_MONITOR,
                 G_SIGNAL_RUN_LAST,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]