mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 18:45:36 +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)
|
Value(Value&& other)
|
||||||
: mOwner(other.mOwner), mIterator(other.mIterator)
|
: mOwner(other.mOwner), mIterator(other.mIterator)
|
||||||
{
|
{
|
||||||
other.mIterator = ItemIterator();
|
other.mOwner = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
~Value()
|
~Value()
|
||||||
{
|
{
|
||||||
if (mIterator != ItemIterator())
|
if (mOwner)
|
||||||
mOwner->releaseItem(mIterator);
|
mOwner->releaseItem(mIterator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,16 +69,13 @@ namespace DetourNavigator
|
||||||
|
|
||||||
Value& operator =(Value&& other)
|
Value& operator =(Value&& other)
|
||||||
{
|
{
|
||||||
if (mIterator == other.mIterator)
|
if (mOwner)
|
||||||
return *this;
|
|
||||||
|
|
||||||
if (mIterator != ItemIterator())
|
|
||||||
mOwner->releaseItem(mIterator);
|
mOwner->releaseItem(mIterator);
|
||||||
|
|
||||||
mOwner = other.mOwner;
|
mOwner = other.mOwner;
|
||||||
mIterator = other.mIterator;
|
mIterator = other.mIterator;
|
||||||
|
|
||||||
other.mIterator = ItemIterator();
|
other.mOwner = nullptr;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +87,7 @@ namespace DetourNavigator
|
||||||
|
|
||||||
operator bool() const
|
operator bool() const
|
||||||
{
|
{
|
||||||
return mIterator != ItemIterator();
|
return mOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue