Index: source/ps/Future.h =================================================================== --- source/ps/Future.h +++ source/ps/Future.h @@ -222,17 +222,6 @@ m_SharedState.reset(); } - /** - * Cancels the task (without waiting). - * The result is always invalid, even if the task had completed before. - * Note that this cannot stop started tasks. - */ - void Cancel() - { - if (m_SharedState) - m_SharedState->Cancel(); - m_SharedState.reset(); - } protected: std::shared_ptr m_SharedState; }; Index: source/ps/tests/test_Future.h =================================================================== --- source/ps/tests/test_Future.h +++ source/ps/tests/test_Future.h @@ -95,8 +95,7 @@ { Future future; std::function task = future.Wrap([]() { return 1; }); - future.Cancel(); - future.Wait(); + future.CancelOrWait(); TS_ASSERT_THROWS(future.Get(), const Future::BadFutureAccess&); } */ Index: source/simulation2/components/CCmpPathfinder.cpp =================================================================== --- source/simulation2/components/CCmpPathfinder.cpp +++ source/simulation2/components/CCmpPathfinder.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -107,7 +107,7 @@ // Wait on all pathfinding tasks. for (Future& future : m_Futures) - future.Cancel(); + future.CancelOrWait(); m_Futures.clear(); SAFE_DELETE(m_AtlasOverlay);