[gnome-initial-setup/shell/4765: 90/362] keyboard: disconnect from settings notification when finalizing



commit 9a4a811d13053e43c4e1ac7aa5a502159bd96ed3
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Mon Jul 14 15:27:31 2014 -0700

    keyboard: disconnect from settings notification when finalizing
    
    Due to the use of g_settings_delay() in the keyboard page, it's
    possible for the backend object to survive the page itself, when the
    locale changes.
    In that scenario, a callback will be triggered with an invalid page
    pointer, which will eventually lead to a crash.
    
    Disconnect all handlers connected by the page when finalizing it.
    
    [endlessm/eos-shell#2904]

 .../pages/keyboard/gis-keyboard-page.c             |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c 
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
index 0d49249..62c1f67 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
@@ -99,9 +99,11 @@ gis_keyboard_page_finalize (GObject *object)
         g_cancellable_cancel (priv->cancellable);
         g_clear_object (&priv->cancellable);
 
+        g_signal_handlers_disconnect_by_data (priv->input_settings, self);
+        g_clear_object (&priv->input_settings);
+
         g_clear_object (&priv->permission);
         g_clear_object (&priv->localed);
-        g_clear_object (&priv->input_settings);
         g_clear_object (&priv->xkb_info);
 #ifdef HAVE_IBUS
         g_clear_object (&priv->ibus);


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