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
This commit is contained in:
Federico Mena Quintero 2009-03-11 15:14:11 +00:00 committed by Federico Mena Quintero
parent 5ed35ac167
commit 38de654eea
2 changed files with 17 additions and 8 deletions

View file

@ -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

View file

@ -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);
}