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

Charles Dang noreply at github.com
Thu Dec 31 07:26:52 UTC 2020


  Branch: refs/heads/wesnothd_cleanup_doc_ptrs
  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).





More information about the Commits mailing list