diff --git a/src/common/scripting/core/dynarrays.cpp b/src/common/scripting/core/dynarrays.cpp index 8c51daa94..1d03fe3a7 100644 --- a/src/common/scripting/core/dynarrays.cpp +++ b/src/common/scripting/core/dynarrays.cpp @@ -846,6 +846,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Copy, ArrayCopy) { PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj); PARAM_POINTER(other, FDynArray_Obj); + for (auto& elem : *other) GC::WriteBarrier(elem); *self = *other; return 0; } @@ -854,6 +855,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Move, ArrayMove) { PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj); PARAM_POINTER(other, FDynArray_Obj); + for (auto& elem : *other) GC::WriteBarrier(elem); *self = std::move(*other); return 0; } @@ -862,6 +864,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Append, ArrayAppend) { PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj); PARAM_POINTER(other, FDynArray_Obj); + for (auto& elem : *other) GC::WriteBarrier(elem); self->Append(*other); return 0; } @@ -883,6 +886,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Push, ObjArrayPush) { PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj); PARAM_OBJECT(val, DObject); + GC::WriteBarrier(val); ACTION_RETURN_INT(ObjArrayPush(self, val)); }