[wesnoth-commits] [wesnoth/wesnoth] da6fb5: Wesnothd: cleaned up usage of document smart pointers

Charles Dang noreply at github.com
Thu Dec 31 09:27:51 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: da6fb5d398aba233be0e61de39acc1b84cc15778
      https://github.com/wesnoth/wesnoth/commit/da6fb5d398aba233be0e61de39acc1b84cc15778
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2020-12-31 (Thu, 31 Dec 2020)

  Changed paths:
    M src/server/common/simple_wml.cpp
    M src/server/common/simple_wml.hpp
    M src/server/wesnothd/game.cpp
    M src/server/wesnothd/game.hpp

  Log Message:
  -----------
  Wesnothd: cleaned up usage of document smart pointers

This removes the use of boost::ptr_vector and replaces it with a vector of unique_ptr<document>.
document::clone was also made to return a unique_ptr, which allows for the unification of doc
pointer management. We don't have stray document pointers anymore, there's no manual deletion,
and it's clear who owns what when (ptr_vector maintains ownership of the pointers it holds, but
it's clearer to have everything using unique_ptr).


  Commit: 6d34bc95c76b43aec9920269bb2cc84a37f9c8e1
      https://github.com/wesnoth/wesnoth/commit/6d34bc95c76b43aec9920269bb2cc84a37f9c8e1
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2020-12-31 (Thu, 31 Dec 2020)

  Changed paths:
    M src/server/common/server_base.cpp
    M src/server/common/server_base.hpp

  Log Message:
  -----------
  Return unique_ptr instead of shared_ptr from coro_receive_doc


  Commit: e750513d25d0c40dc8669f0a3929370940bcbf76
      https://github.com/wesnoth/wesnoth/commit/e750513d25d0c40dc8669f0a3929370940bcbf76
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2020-12-31 (Thu, 31 Dec 2020)

  Changed paths:
    M src/server/wesnothd/server.cpp
    M src/server/wesnothd/server.hpp

  Log Message:
  -----------
  Made handle_player_in_[lobby/game] take a document reference instead of a shared_ptr


  Commit: fec6c32bef7f5a6b329482ff1f4bf0f10fc9b31e
      https://github.com/wesnoth/wesnoth/commit/fec6c32bef7f5a6b329482ff1f4bf0f10fc9b31e
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2020-12-31 (Thu, 31 Dec 2020)

  Changed paths:
    M src/server/common/server_base.cpp

  Log Message:
  -----------
  Used unique_ptrs in async_send_doc_queued


  Commit: 7cc4f3b689a945249fb1c381982f30f0f2c5b537
      https://github.com/wesnoth/wesnoth/commit/7cc4f3b689a945249fb1c381982f30f0f2c5b537
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2020-12-31 (Thu, 31 Dec 2020)

  Changed paths:
    M src/server/common/server_base.cpp
    M src/server/common/server_base.hpp
    M src/server/common/simple_wml.cpp
    M src/server/common/simple_wml.hpp
    M src/server/wesnothd/game.cpp
    M src/server/wesnothd/game.hpp
    M src/server/wesnothd/server.cpp
    M src/server/wesnothd/server.hpp

  Log Message:
  -----------
  Merge pull request #5401 from wesnoth/wesnothd_cleanup_doc_ptrs

Wesnothd: cleaned up usage of document smart pointers


Compare: https://github.com/wesnoth/wesnoth/compare/529cb81185dc...7cc4f3b689a9



More information about the Commits mailing list