Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- clear intermediate entries when inserting an object beyond the end …
…of an array.
  • Loading branch information
coelckers committed Oct 17, 2020
1 parent 3b45f1c commit 38df70f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/scripting/core/dynarrays.cpp
Expand Up @@ -880,8 +880,10 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Delete, ArrayDelete<FDynArray_Obj>)

void ObjArrayInsert(FDynArray_Obj *self,int index, DObject *obj)
{
int oldSize = self->Size();
GC::WriteBarrier(obj);
self->Insert(index, obj);
for (unsigned i = oldSize; i < self->Size() - 1; i++) (*self)[i] = nullptr;
}

DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Insert, ObjArrayInsert)
Expand Down

0 comments on commit 38df70f

Please sign in to comment.