[Scummvm-devel] Bugs blocking the DS port: SAGA Engine font loading crash, Options menus crash, GMM load/save crash

Johannes Schickel lordhoto at scummvm.org
Sun May 15 14:21:57 CEST 2011


> 2.
> 
> In gui/options.cpp, closing any options dialog crashes the game (by
> running out of RAM).
> 
> I tracked this down to this code in OptionsDialog::handleCommand():
> 
> case kCloseCmd:
>          if (g_gui.theme()->getThemeId() != _oldTheme) {
>              g_gui.loadNewTheme(_oldTheme);
>              ConfMan.set("gui_theme", _oldTheme);
>          }
>          close();
>          break;
> 
> This looks like it's intended to reload the theme if the selection was
> changed.  For me, the g_gui.theme()->getThemeId() returns the name of
> the modern theme, while _oldTheme specifies 'builtin'.  This causes the
> 'builtin' theme to be reloaded, crashing ScummVM due to lack of memory.
> 
> ScummVM DS always uses the 'builtin' theme due to memory constraints.
> 
> I have fixed this (for me) by changing the following in
> OptionsDialog::init()
> 
>      _oldTheme = ConfMan.get("gui_theme");
> becomes
>      _oldTheme = g_gui.theme()->getThemeId();
> 
> I  haven't got a way of testing this on other ports, so if somebody
> could advice me if this is sensible, I'll make the change.
> 

Yeah that should also be fine.

Usually "gui_theme" should contain the same value as getThemeId, except in the 
case you described, i.e. when the theme specified in the config does not exist.

// Johannes




More information about the Scummvm-devel mailing list