File gnome-control-center-bnc457772-bgo574865-randr-dangling-pointer.diff of Package gnome-control-center

bgo574865 (RANDR) - Don't leave a dangling pointer for the current_output when the RANDR configuration changes

diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index 6bf8026..08c376c 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -130,6 +130,7 @@ on_screen_changed (GnomeRRScreen *scr,
 	gnome_rr_config_free (app->current_configuration);
 
     app->current_configuration = current;
+    app->current_output = NULL;
 
 #if 0
     for (i = 0; app->current_configuration->outputs[i] != NULL; ++i)
@@ -1944,14 +1945,9 @@ static void
 select_current_output_from_dialog_position (App *app)
 {
     if (GTK_WIDGET_REALIZED (app->dialog))
-    {
-	GnomeOutputInfo *output;
-
-	output = get_output_for_window (app->current_configuration, app->dialog->window);
-
-	if (output)
-	    app->current_output = output;
-    }
+	app->current_output = get_output_for_window (app->current_configuration, app->dialog->window);
+    else
+	app->current_output = NULL;
 
     rebuild_gui (app);
 }
openSUSE Build Service is sponsored by