summaryrefslogtreecommitdiff
path: root/capplets/display
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2009-03-11 15:14:11 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2009-03-11 15:14:11 +0000
commit38de654eea40fb559dc67467900cc7e890347ce6 (patch)
tree0f5395e70d22a43c36a693033cdb5c1330b5dda5 /capplets/display
parent5ed35ac1671cffad070c8c3338680cb4853c79fe (diff)
downloadgnome-control-center-38de654eea40fb559dc67467900cc7e890347ce6.tar.gz
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> svn path=/trunk/; revision=9339
Diffstat (limited to 'capplets/display')
-rw-r--r--capplets/display/ChangeLog13
-rw-r--r--capplets/display/xrandr-capplet.c12
2 files changed, 17 insertions, 8 deletions
diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog
index 0d43f45c3..4bdc6b64c 100644
--- a/capplets/display/ChangeLog
+++ b/capplets/display/ChangeLog
@@ -1,3 +1,16 @@
+2009-03-11 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.
+
2009-03-11 Gabor Kelemen <kelemeng@gnome.hu>
* xrandr-capplet.c: Make the strings of the Rotation dialog appear
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index e46b88ad2..4262e54ba 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);
}