[wesnoth-commits] [wesnoth/wesnoth] 97183e: Revert "Mark game_events::manager::execute_on_even...

GitHub noreply at github.com
Sat Mar 10 15:26:39 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 97183e37c8c36b167af956d9004d5b1b71b075cf
      https://github.com/wesnoth/wesnoth/commit/97183e37c8c36b167af956d9004d5b1b71b075cf
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2018-03-10 (Sat, 10 Mar 2018)

  Changed paths:
    M src/game_events/manager.cpp
    M src/game_events/manager.hpp

  Log Message:
  -----------
  Revert "Mark game_events::manager::execute_on_events() as noexcept"

This reverts commit 45cab78cfb67441dff36826162e36c980a72a222.

Further testing indicates that exceptions can indeed pass through the
function, and therefore marking it as noexcept isn't safe.


  Commit: 857f5a9e7101d673c711d70655fc941a75eb23ad
      https://github.com/wesnoth/wesnoth/commit/857f5a9e7101d673c711d70655fc941a75eb23ad
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2018-03-10 (Sat, 10 Mar 2018)

  Changed paths:
    M src/game_events/manager.cpp
    M src/game_events/manager.hpp
    M src/play_controller.cpp

  Log Message:
  -----------
  Use a RAII class to block game event handler cleanup

This ensures that throwing an exception through
game_events::manager::execute_on_events() won't corrupt the stack frame
counter and disable event handler cleanup forever.

I also added a safety check in case there are some kind of ephemeral
event handlers which run a nested game loop and never return. Saving in
such a state wouldn't be safe.


  Commit: 7637a36c3f82cea8854baf89196cfae194631e05
      https://github.com/wesnoth/wesnoth/commit/7637a36c3f82cea8854baf89196cfae194631e05
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2018-03-10 (Sat, 10 Mar 2018)

  Changed paths:
    M src/game_events/manager.cpp

  Log Message:
  -----------
  Assert that there are no disabled event handlers when saving

If there are still issues with this, it's better for the game to
complain about the problem loudly than sweep it under the carpet.


Compare: https://github.com/wesnoth/wesnoth/compare/45cab78cfb67...7637a36c3f82


More information about the Commits mailing list