[Commits] [wesnoth/wesnoth] 28fe7e: fixbug 22611: don't close the program if we can't ...

GitHub noreply at github.com
Sat Sep 13 16:21:28 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 28fe7e440c62b9611129774b765b3d2aa8fbad5b
      https://github.com/wesnoth/wesnoth/commit/28fe7e440c62b9611129774b765b3d2aa8fbad5b
  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.

Conflicts:
	src/widgets/button.cpp
  (just the #include reorder)


  Commit: 3417360552bd2b2c6177f8f38606eebe3ee5854d
      https://github.com/wesnoth/wesnoth/commit/3417360552bd2b2c6177f8f38606eebe3ee5854d
  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/1c691319378e...3417360552bd


More information about the Commits mailing list