commit 63257352270866803c0e98afae23b2393f964e32
Author: Federico Mena Quintero <federico@novell.com>
Date:   Tue Mar 10 18:06:39 2009 -0600

    bgo574865 (RANDR) - Don't leave a dangling pointer for the current_output when the RANDR configuration changes
    
    Signed-off-by: Federico Mena Quintero <federico@novell.com>

diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog
index 4cf5c70..85676eb 100644
--- a/capplets/display/ChangeLog
+++ b/capplets/display/ChangeLog
@@ -1,3 +1,16 @@
+2009-03-10  Federico Mena Quintero  <federico@novell.com>
+
+	http://bugzilla.gnome.org/show_bug.cgi?id=574865 - Crash when
+	refreshing the RANDR configuration.
+
+	* xrandr-capplet.c (select_current_output_from_dialog_position):
+	Always set app->current_output; otherwise we could be left with a
+	dangling pointer to the old current_output (which is invalid after
+	refreshing the current_configuration).
+	(on_screen_changed): Null out the current_output when we get a new
+	RANDR configuration, as it will become obsolete as soon as we free
+	the old configuration.
+
 ==================== 2.25.92 ====================
 
 2009-02-21  Jens Granseuer  <jensgr@gmx.net>
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);
 }
