[gnome-flashback] input-sources: use copied list in GfInputSourcePopup



commit a0efec0741119d5e37c6b0ec818d6af0217e30a7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Sep 24 23:26:47 2015 +0300

    input-sources: use copied list in GfInputSourcePopup

 .../libinput-sources/gf-input-source-popup.c       |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-input-source-popup.c 
b/gnome-flashback/libinput-sources/gf-input-source-popup.c
index 20c5cc6..94cbf7a 100644
--- a/gnome-flashback/libinput-sources/gf-input-source-popup.c
+++ b/gnome-flashback/libinput-sources/gf-input-source-popup.c
@@ -236,6 +236,22 @@ gf_input_source_popup_constructed (GObject *object)
 }
 
 static void
+gf_input_source_popup_dispose (GObject *object)
+{
+  GfInputSourcePopup *popup;
+
+  popup = GF_INPUT_SOURCE_POPUP (object);
+
+  if (popup->mru_sources != NULL)
+    {
+      g_list_free (popup->mru_sources);
+      popup->mru_sources = NULL;
+    }
+
+  G_OBJECT_CLASS (gf_input_source_popup_parent_class)->dispose (object);
+}
+
+static void
 gf_input_source_popup_set_property (GObject      *object,
                                     guint         prop_id,
                                     const GValue *value,
@@ -248,7 +264,7 @@ gf_input_source_popup_set_property (GObject      *object,
   switch (prop_id)
     {
       case PROP_MRU_SOURCES:
-        popup->mru_sources = g_value_get_pointer (value);
+        popup->mru_sources = g_list_copy (g_value_get_pointer (value));
         break;
 
       case PROP_BACKWARD:
@@ -428,6 +444,7 @@ gf_input_source_popup_class_init (GfInputSourcePopupClass *popup_class)
   widget_class = GTK_WIDGET_CLASS (popup_class);
 
   object_class->constructed = gf_input_source_popup_constructed;
+  object_class->dispose = gf_input_source_popup_dispose;
   object_class->set_property = gf_input_source_popup_set_property;
 
   widget_class->button_press_event = gf_input_source_popup_button_press_event;


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