mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- fixed: all script methods adding an object to a dynamic array must perform a write barrier.
This commit is contained in:
parent
175c91308a
commit
c87e87365d
1 changed files with 4 additions and 0 deletions
|
@ -846,6 +846,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Copy, ArrayCopy<FDynArray_Obj>)
|
|||
{
|
||||
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<FDynArray_Obj>)
|
|||
{
|
||||
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<FDynArray_Obj>)
|
|||
{
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue