[gnome-settings-daemon] power: bail out early if the GnomeRRScreen could not be created



commit 229ed6537c82a11a408a4fbfa2f9809b8aa0c8e9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Dec 6 14:29:20 2013 +0100

    power: bail out early if the GnomeRRScreen could not be created
    
    This may happen in the case gnome-shell is not running when g-s-d starts
    up. This fixes a crash in such situation, as priv->rr_screen was assumed
    to exist soon after.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719974

 plugins/power/gsd-power-manager.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 1f1d12e..be1e127 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2257,10 +2257,19 @@ on_rr_screen_acquired (GObject      *object,
                        gpointer      user_data)
 {
         GsdPowerManager *manager = user_data;
+        GError *error = NULL;
 
         gnome_settings_profile_start (NULL);
 
-        manager->priv->rr_screen = gnome_rr_screen_new_finish (result, NULL);
+        manager->priv->rr_screen = gnome_rr_screen_new_finish (result, &error);
+
+        if (error) {
+                g_warning ("Could not create GnomeRRScreen: %s\n", error->message);
+                g_error_free (error);
+                gnome_settings_profile_end (NULL);
+
+                return;
+        }
 
         /* set up the screens */
         if (manager->priv->lid_is_present) {


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