The only thing this commit did was mess around with dangled pointer
access timings instead of solving the original UB that it was supposed
to fix (see bug #18495). There's no problem with accessing theme UI
buttons before they are initialized since they will be NULL and the
replay controller already made sure to not do silly crap with NULL
pointers (except for the case spotted in 2011-11-04T04:27:26Z!shadowm@wesnoth.org).
(IRC users: please read the entire commit message instead of relyingon CIA.)
2011-02-07T21:43:12Z!b.waresiak@gmail.com introduced some code, purportedly intended to fix bug
#16237, which relied on game_display/display never destroying buttons
returned by the find_button() method. Unfortunately, many code paths
calling game_display/display::draw() cause them to be destroyed and
recreated, resulting in UB from code that still keeps the old pointers
around and doesn't refresh them before use.
This commit removes the replay_controller::replay_buttons_wrapper
class and reintegrates its code into the replay_controller class to
remove one unrequired abstraction layer, without entirely reverting
2011-02-07T21:43:12Z!b.waresiak@gmail.com. It also makes sure pointers aren't kept for longer than
necessary, disposing of them after use and calling
game_display/display::find_button() every single time a button has to
be accessed. This shouldn't result in noticeable runtime overhead
increase as the buttons are stored in a vector which is rarely very
large (I have yet to see a Wesnoth GUI theme that has more than ten
buttons).
As a side-effect of my changes, however, a glitch on the Skip
Animations checkbox background has appeared. Considering I don't touch
that button at all, it's possible there's a different cause for it
that was concealed by the replay buttons' triggered UB.
I don't think this side-effect is more important at this point than the
original bug, and I or someone else can investigate it later.
NOTE: If someone has a reasonable argument for this commit being
reverted before 1.9.10, feel free to discuss that with me.
silene had agreed in making this function available. He wanted me to
add it as wesnoth.traceback though, supposedly just because it
would've been easier for me at that time.
...if there's no End Turn button in the theme GUI when displaying a context menu
a) Yes, it makes sense to not have an End Turn button.
b) No, it doesn't make sense to rely on the existence of an End Turn
button.
c) Yes, this change is completely harmless.
...correct again
alink pointed out that 2011-10-31T19:45:47Z!shadowm@wesnoth.org inverted the meaning of the
warning, so invert it again and "try" to explain why modifiers are
recommended.
...since pofix doesn't know about textdomains and does partial
matching for some retarded reason
Too bad I still wasted my time doing lots of copy/paste because nobody
explained this to me.