mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 22:09:39 +00:00
Merge pull request #2260 from elsid/fix_clean_unused_navmeshes
Fix clean unused navmeshes
This commit is contained in:
commit
45221418bd
1 changed files with 2 additions and 1 deletions
|
@ -22,7 +22,8 @@ namespace
|
||||||
template <class T>
|
template <class T>
|
||||||
bool resetIfUnique(std::shared_ptr<T>& ptr)
|
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())
|
if (auto shared = weak.lock())
|
||||||
{
|
{
|
||||||
ptr = std::move(shared);
|
ptr = std::move(shared);
|
||||||
|
|
Loading…
Reference in a new issue