Re: [AD] active_menu_player bug |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, 2005-05-26 at 18:03 +0200, Julien Cugnière wrote:
> Hi,
>
> In src/gui.c, when d_menu_proc opens a new menu, it sets the global pointer
> "active_menu_player". This pointer is only ever used for menus started by
> d_menu_proc.
>
> There is a non documented assumption that the menu player designated by
> active_menu_player was started by a d_menu_proc that is part of the currently
> active dialog.
>
> When a new dialog is started while the current one has a menu open, the
> assumption is broken: the currently active menu and the currently active
> dialog do not match anymore. This leads to a crash.
>
> The attached patch documents the assumption, enforces it with an ASSERT (more
> might be needed), and fixes the crash by making init_dialog close the
> active_menu_player if necessary.
Makes sense. But what I'm wondering, how can you open a new dialog while
a menu is open? As soon as you click anywhere, it will close..
> However, I don't claim to fully understand the code in gui.c (it is rather
> intricate :-), so my fix might not be the best one, or even correct!
Yes, the gui code is quite a mess, unfortunately.
--
Elias Pschernig