mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 15:15:40 +00:00
Merge pull request #2072 from elsid/navmesh_tiles_cache_item_fix
Navmesh tiles cache item fix (bug #4751)
This commit is contained in:
commit
401ccedb36
1 changed files with 5 additions and 8 deletions
|
@ -56,12 +56,12 @@ namespace DetourNavigator
|
|||
Value(Value&& other)
|
||||
: mOwner(other.mOwner), mIterator(other.mIterator)
|
||||
{
|
||||
other.mIterator = ItemIterator();
|
||||
other.mOwner = nullptr;
|
||||
}
|
||||
|
||||
~Value()
|
||||
{
|
||||
if (mIterator != ItemIterator())
|
||||
if (mOwner)
|
||||
mOwner->releaseItem(mIterator);
|
||||
}
|
||||
|
||||
|
@ -69,16 +69,13 @@ namespace DetourNavigator
|
|||
|
||||
Value& operator =(Value&& other)
|
||||
{
|
||||
if (mIterator == other.mIterator)
|
||||
return *this;
|
||||
|
||||
if (mIterator != ItemIterator())
|
||||
if (mOwner)
|
||||
mOwner->releaseItem(mIterator);
|
||||
|
||||
mOwner = other.mOwner;
|
||||
mIterator = other.mIterator;
|
||||
|
||||
other.mIterator = ItemIterator();
|
||||
other.mOwner = nullptr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
@ -90,7 +87,7 @@ namespace DetourNavigator
|
|||
|
||||
operator bool() const
|
||||
{
|
||||
return mIterator != ItemIterator();
|
||||
return mOwner;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue