From 8adc83f6e2d240f372cf7bdc6dffabcbd0391d8d Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 17 Mar 2019 21:24:49 +0300 Subject: [PATCH] Fix clean unused navmeshes weak_ptr doesn't have constructor for shared_ptr&& type, so ptr wasn't moved, just copied. --- components/detournavigator/navmeshmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);