[Commits] [wesnoth/wesnoth] 2b2c08: fixbug 22611: don't close the program if we can't ...
GitHub
noreply at github.com
Sat Sep 13 16:14:00 UTC 2014
Branch: refs/heads/1.12
Home: https://github.com/wesnoth/wesnoth
Commit: 2b2c087da137772272fa7245cd5cbff78e4ad8da
https://github.com/wesnoth/wesnoth/commit/2b2c087da137772272fa7245cd5cbff78e4ad8da
Author: Chris Beck <render787 at gmail.com>
Date: 2014-09-13 (Sat, 13 Sep 2014)
Changed paths:
M src/widgets/button.cpp
Log Message:
-----------
fixbug 22611: don't close the program if we can't find button image
If the main button image could not be loaded, the previous code
would throw an exception of an obscure type "error". It appears that
this was not caught anywhere except the main function in wesnoth.cpp
and so the program would close immediately.
I first tried to go into the gui initialization and construct
buttons in try catch blocks, skipping ones that have problems, but
rather than being able to proceed, this just causes a segfault
because other parts of the code assume that all buttons have been
constructed successfully. This means that not finding the image is
necessarily a fatal error.
My fix for the problem is, instead of throwing error, we throw the
more standard "game::game_error". The new behavior is, if you try
to load a theme with nonexistant images, then a black screen will
appear with a dialog
"error initializing button images! filename: buttons/dontexist.png"
The game then returns to the title screen.
Commit: 8f20744f5178fd284d2fe87b8106a6c240fb3082
https://github.com/wesnoth/wesnoth/commit/8f20744f5178fd284d2fe87b8106a6c240fb3082
Author: Chris Beck <render787 at gmail.com>
Date: 2014-09-13 (Sat, 13 Sep 2014)
Changed paths:
M changelog
Log Message:
-----------
update changelog
Compare: https://github.com/wesnoth/wesnoth/compare/c8ccd406ef99...8f20744f5178
More information about the Commits
mailing list