[Commits] [wesnoth/wesnoth] 368ce7: main catches and handles "std::exception" and "......

GitHub noreply at github.com
Sun Jun 8 12:06:51 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 368ce7f871fedbd3882768f78633718fd689e719
      https://github.com/wesnoth/wesnoth/commit/368ce7f871fedbd3882768f78633718fd689e719
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-06-06 (Fri, 06 Jun 2014)

  Changed paths:
    M src/game.cpp

  Log Message:
  -----------
  main catches and handles "std::exception" and "...", returning 1

The purpose of this is so that even when we request the program
to be terminated with "throw 42", the exception will still
propogate back to main and all destructors will be called along
the way. This way, if the program requested a socket for example,
the socket will still be released when we terminate unexpectedly,
so it might be slightly more convenient for testing.


  Commit: 6c2dc69a7f36657390fc8285f2f117ca486a64bb
      https://github.com/wesnoth/wesnoth/commit/6c2dc69a7f36657390fc8285f2f117ca486a64bb
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-06-06 (Fri, 06 Jun 2014)

  Changed paths:
    M src/game.cpp

  Log Message:
  -----------
  Add also exception handlers for strings thrown as exceptions

>From irc:

<gfgtdf> iceiceice: i tink you should also catch for char* there,
to give the correct message in case of
'throw "asdadsad"; 'statemant


  Commit: 0d0c5df85a62a73c5447c96d20e871da06b1c2b8
      https://github.com/wesnoth/wesnoth/commit/0d0c5df85a62a73c5447c96d20e871da06b1c2b8
  Author: Chris Beck <beck.ct at gmail.com>
  Date:   2014-06-08 (Sun, 08 Jun 2014)

  Changed paths:
    M src/game.cpp

  Log Message:
  -----------
  Merge pull request #194 from cbeck88/add_catch_all_to_main

main catches and handles all exceptions last, returning 1

This is to ensure that all resources are freed even after a crash.


Compare: https://github.com/wesnoth/wesnoth/compare/2bdb4568eb71...0d0c5df85a62


More information about the Commits mailing list