URL:
  <http://gna.org/patch/?1919>

                 Summary: Possible fix for GUI2 titlescreen timer errors.
                 Project: Battle for Wesnoth
            Submitted by: alink
            Submitted on: Saturday 09/04/2010 at 06:58
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: mordante
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

When hovering buttons during logo animations, I have some errors
"gui/event: Can't execute timer since it no longer exists."

I believe that it's because remove_timer erases id for the timers map, when
there may still have TIMER_EVENT using this id in the event queue. When these
events are handled, error happens since the id was freed (or even worse
assigned to another new more recent timer).

A possible solution is to not directly remove it from timers, but mark it as
"to be removed" (= insert the id in a 'removed' set) and send a TIMER_EVENT
with a special value 'free me' in the code field (which is unused for the
moment). The function execute_timer could just do nothing when the id is in
the 'removed' set. And when handling event TIMER_EVENT, we read the code
field: if it's 0 execute it and if it's 'free me' then really free the id
(=erase from timers and removed). There is other ways, but we can't really
control the content and flow of the event queue, so let's use it.

I didn't commit anything (or even fully write this) because you may have a
better idea and there is still some detail about a special case with the
'executing_id_removed'. If you like the idea but are too busy, I can try it,
even if it would be safer done by you since you know the whole code (I only
checked timer.?pp).

PS: I didn't code it yet, just checked some debug output, so it's just a
guess, but the problem seems real and the fix adapted.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?1919>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to