mirror of https://github.com/snes9xgit/snes9x.git
Allocate preferences on the stack to try and fix double free.
This commit is contained in:
parent
898e204fcf
commit
92cc3dbc2a
|
@ -19,21 +19,20 @@ gboolean
|
||||||
snes9x_preferences_open (GtkWidget *widget,
|
snes9x_preferences_open (GtkWidget *widget,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
Snes9xPreferences *preferences;
|
|
||||||
Snes9xWindow *window = ((Snes9xWindow *) data);
|
Snes9xWindow *window = ((Snes9xWindow *) data);
|
||||||
Snes9xConfig *config = window->config;
|
Snes9xConfig *config = window->config;
|
||||||
|
|
||||||
window->pause_from_focus_change ();
|
window->pause_from_focus_change ();
|
||||||
|
|
||||||
preferences = new Snes9xPreferences (config);
|
Snes9xPreferences preferences (config);
|
||||||
gtk_window_set_transient_for (preferences->get_window (),
|
gtk_window_set_transient_for (preferences.get_window (),
|
||||||
window->get_window ());
|
window->get_window ());
|
||||||
|
|
||||||
#ifdef USE_JOYSTICK
|
#ifdef USE_JOYSTICK
|
||||||
config->set_joystick_mode (JOY_MODE_GLOBAL);
|
config->set_joystick_mode (JOY_MODE_GLOBAL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
preferences->show ();
|
preferences.show ();
|
||||||
window->unpause_from_focus_change ();
|
window->unpause_from_focus_change ();
|
||||||
|
|
||||||
#ifdef USE_JOYSTICK
|
#ifdef USE_JOYSTICK
|
||||||
|
@ -43,8 +42,6 @@ snes9x_preferences_open (GtkWidget *widget,
|
||||||
config->reconfigure ();
|
config->reconfigure ();
|
||||||
window->update_accels ();
|
window->update_accels ();
|
||||||
|
|
||||||
delete preferences;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue