[Commits] [wesnoth/wesnoth] cddc2d: Editor: fix crash when closing map (fixup bf79dbd8...

GitHub noreply at github.com
Thu Apr 27 20:07:56 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: cddc2d2f69194f6802635e66c016c1a0bafdfefc
      https://github.com/wesnoth/wesnoth/commit/cddc2d2f69194f6802635e66c016c1a0bafdfefc
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-04-28 (Fri, 28 Apr 2017)

  Changed paths:
    M src/editor/map/context_manager.cpp

  Log Message:
  -----------
  Editor: fix crash when closing map (fixup bf79dbd8)

I had moved the creation of the map_context_refresher prior to deleting a context since I thought it was
necessary to not access invalid memory. Turns out doing that was wrong; doing so caused the crash.

However, this results in a slight change in the code's result: Before, it was taking a ptr to the
current context, modifying the container, and then creating the refresher. This allowed the size_changed_
variable to be correctly initialized. That variable is unused, though, so it makes no difference.


  Commit: 509937305bf1796ba37ad06e51140c08331be24e
      https://github.com/wesnoth/wesnoth/commit/509937305bf1796ba37ad06e51140c08331be24e
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-04-28 (Fri, 28 Apr 2017)

  Changed paths:
    M src/editor/map/context_manager.cpp

  Log Message:
  -----------
  Removed unused member from map_context_refresher

This actually appears to have gone unused since the beginning. Peculiar. Either way, this removes
the need to pass a map context object.


Compare: https://github.com/wesnoth/wesnoth/compare/0dfe846090ef...509937305bf1


More information about the Commits mailing list