mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-08 16:52:01 +00:00
Fix iterator invalidation for Map::Get
This commit is contained in:
parent
698bd251ea
commit
fed2d11be5
1 changed files with 2 additions and 0 deletions
|
@ -125,6 +125,7 @@ template<typename M> expand_types_vm<typename M::ValueType> MapGet(M * self,expa
|
||||||
{
|
{
|
||||||
typename M::ValueType n {};
|
typename M::ValueType n {};
|
||||||
self->Insert(key,n);
|
self->Insert(key,n);
|
||||||
|
self->info->rev++; // invalidate iterators
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,6 +140,7 @@ template<typename M> void MapGetString(M * self,expand_types_vm<typename M::KeyT
|
||||||
{
|
{
|
||||||
out = FString();
|
out = FString();
|
||||||
self->Insert(key,out);
|
self->Insert(key,out);
|
||||||
|
self->info->rev++; // invalidate iterators
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue