mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
Merge pull request #2260 from elsid/fix_clean_unused_navmeshes
Fix clean unused navmeshes
This commit is contained in:
commit
45221418bd
@ -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…
x
Reference in New Issue
Block a user