mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +00:00
Fix clean unused navmeshes
weak_ptr doesn't have constructor for shared_ptr&& type, so ptr wasn't moved, just copied.
This commit is contained in:
parent
ab69ad65ed
commit
8adc83f6e2
@ -22,7 +22,8 @@ namespace
|
||||
template <class T>
|
||||
bool resetIfUnique(std::shared_ptr<T>& ptr)
|
||||
{
|
||||
const std::weak_ptr<T> weak = std::move(ptr);
|
||||
const std::weak_ptr<T> weak(ptr);
|
||||
ptr.reset();
|
||||
if (auto shared = weak.lock())
|
||||
{
|
||||
ptr = std::move(shared);
|
||||
|
Loading…
x
Reference in New Issue
Block a user