[wesnoth-commits] [wesnoth/wesnoth] 6b30c1: Refactor out custom wesnothd_connection_ptr class ...

GitHub noreply at github.com
Wed Oct 17 03:31:58 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 6b30c18d54464ae5324c3e468fcf46d2a063add2
      https://github.com/wesnoth/wesnoth/commit/6b30c18d54464ae5324c3e468fcf46d2a063add2
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-10-17 (Wed, 17 Oct 2018)

  Changed paths:
    M src/wesnothd_connection.cpp

  Log Message:
  -----------
  Refactor out custom wesnothd_connection_ptr class again

I originally did this in 699047766a8852014df20c44d5ed84dadb37015e and then reverted it in
08a866dc20e678602f65f0cdedb21fb28a0bfa8c due to @gfgtdf pointing out the object was never
actually destroyed since io_service::stop was never called (issue #1927).

This new method foregoes the custom wrapper class and instead waits for the worker thread
to terminate in the wesnothd_connection dtor. The use of the wrapper class is also why using
thread::detach alone worked (@jyrkive) and using join did not.

Additionally, the ptr alias is now of a unique_ptr instead of a shared_ptr.

I have verified that the connection dtor is actually called. This new method makes it clearer
what's actually going on.


  Commit: f6933b98f8b582e89981f89c0c9206daf5f9163b
      https://github.com/wesnoth/wesnoth/commit/f6933b98f8b582e89981f89c0c9206daf5f9163b
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-10-17 (Wed, 17 Oct 2018)

  Changed paths:
    M src/wesnothd_connection.cpp

  Log Message:
  -----------
  Shot-in-the-dark attempt to fix the tests


Compare: https://github.com/wesnoth/wesnoth/compare/121365f4d297...f6933b98f8b5
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the Commits mailing list