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



commit 500c671ac01036070246f6b2b62f8f192c4e5546
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 e92dc11ac..8e863d791 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]