Ted Gould has proposed merging lp:~ted/indicator-session/lp864085 into lp:indicator-session.
Requested reviews: Indicator Applet Developers (indicator-applet-developers) Related bugs: Bug #867926 in indicator-session (Ubuntu): "gtk-logout-helper crashed with SIGSEGV in g_variant_unref()" https://bugs.launchpad.net/ubuntu/+source/indicator-session/+bug/867926 For more details, see: https://code.launchpad.net/~ted/indicator-session/lp864085/+merge/78733 Protect against the case where we can't get the settings for whatever reason. -- https://code.launchpad.net/~ted/indicator-session/lp864085/+merge/78733 Your team ayatana-commits is subscribed to branch lp:indicator-session.
=== modified file 'src/settings-helper.c' --- src/settings-helper.c 2011-09-06 15:52:08 +0000 +++ src/settings-helper.c 2011-10-08 19:54:23 +0000 @@ -38,41 +38,44 @@ static guint restart_notify = 0; static guint shutdown_notify = 0; -static void +static gboolean build_settings (void) { - if(!settings) { + if (settings == NULL) { settings = g_settings_new (SESSION_SCHEMA); } - return; + if (settings == NULL) { + return FALSE; + } + return TRUE; } gboolean supress_confirmations (void) { - build_settings(); + g_return_val_if_fail(build_settings(), FALSE); return g_settings_get_boolean (settings, SUPPRESS_KEY) ; } gboolean should_show_user_menu (void) { - build_settings(); + g_return_val_if_fail(build_settings(), TRUE); return g_settings_get_boolean (settings, SHOW_USER_MENU) ; } gboolean show_logout (void) { - build_settings(); + g_return_val_if_fail(build_settings(), TRUE); return !g_settings_get_boolean (settings, LOGOUT_KEY) ; } gboolean show_restart (void) { - build_settings(); + g_return_val_if_fail(build_settings(), TRUE); return !g_settings_get_boolean (settings, RESTART_KEY) ; } gboolean show_shutdown (void) { - build_settings(); + g_return_val_if_fail(build_settings(), TRUE); return !g_settings_get_boolean (settings, SHUTDOWN_KEY) ; } @@ -122,7 +125,7 @@ void update_menu_entries(RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi) { /* If we don't have a client, build one. */ - build_settings(); + g_return_if_fail(build_settings()); if (confirmation_notify != 0) { g_signal_handler_disconnect (settings, confirmation_notify);
_______________________________________________ Mailing list: https://launchpad.net/~ayatana-commits Post to : ayatana-commits@lists.launchpad.net Unsubscribe : https://launchpad.net/~ayatana-commits More help : https://help.launchpad.net/ListHelp