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

Charles Dang noreply at github.com
Thu Dec 31 06:46:54 UTC 2020


  Branch: refs/heads/wesnothd_cleanup_doc_ptrs
  Home:   https://github.com/wesnoth/wesnoth
  Commit: fb682c6929c6883d78704fb0da1035404d3a8064
      https://github.com/wesnoth/wesnoth/commit/fb682c6929c6883d78704fb0da1035404d3a8064
  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