diff --git a/components/detournavigator/navmeshmanager.cpp b/components/detournavigator/navmeshmanager.cpp index fc3563acee..871bb6e593 100644 --- a/components/detournavigator/navmeshmanager.cpp +++ b/components/detournavigator/navmeshmanager.cpp @@ -22,7 +22,8 @@ namespace template bool resetIfUnique(std::shared_ptr& ptr) { - const std::weak_ptr weak = std::move(ptr); + const std::weak_ptr weak(ptr); + ptr.reset(); if (auto shared = weak.lock()) { ptr = std::move(shared);