韦诺之战
Go to file
Ignacio R. Morelle 1cecf57cc7 Fix undefined behavior in replay controller UI (bug #18892, bug #18495)
(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.
2011-11-04 04:20:23 +00:00
attic
cmake
data
doc
fonts
graphincludes/project
icons
images
misc/fortunes
packaging
po
projectfiles
resources
scons
sounds
src
utils
website
.gitignore
changelog
CMakeLists.txt
config.h.cmake
COPYING
copyright
Doxyfile
INSTALL
l10n-spec
l10n-track
players_changelog
py-compile
README
RELEASE_NOTES
SConstruct
wesnoth.kdevelop

The game's license is described in COPYING.  Note that for artwork and
music, we interpret "preferred form of the work for making modifications" as
the modifiable form that the author chooses to ship us for the source tree.

See INSTALL for instructions on how to build the game from source code.

A (translated) description of how to play the game can be found in 
doc/manual/manual.*.html .

To be notified of new releases, subscribe to this rss feed:
    http://feed43.com/wesnoth.xml
It does list all news from the Wesnoth frontpage, so you will also have some
additional notifications, but at least you should be aware of all releases.

Wesnoth User and Developer Forums (with over 390,000 posts from more
than 16,000 registered members) can be found at
    http://forums.wesnoth.org/

For extensive documentation about all aspects of the game, see the
official Battle for Wesnoth web site:
    http://www.wesnoth.org/

David White <davidnwhite@verizon.net>