Re: [AD] Bug in GUI recursion.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Jonathan Stephens wrote:
I belive I have found a bug in Allegro's GUI routines, involving whenever you create a new GUI dialog inside of another. It doesn't seem to have trouble if you create a new dialog from a GUI menu, but if you create a new one from a d_proc function, like in the attached example, it crashes in do_dialog. The attached program sould make a new widow with a button, clicking the button should make a new dialog (in this case, the same one), but the program crashes when it get to do_dialog the second time around.

In the example you provided, the crash occurs because clicking the button creates *thousands* of dialogs. MSG_CLICK is sent continually to a proc while a mouse button is pressed. On a fast computer, even if you click very briefly, the program has the time to create thousands of dialogs before you release the mouse button.

In this case, I think you want to use the MSG_LPRESS message instead. This creates only one dialog, and makes the crash go away.

--
Julien Cugnière




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/