mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- fixed potential garbage collection of still referenced objects
Objects from dynamic array stored in items of array of structures were incorrectly treated as unreachable https://forum.zdoom.org/viewtopic.php?t=61354
This commit is contained in:
parent
7e69cd862e
commit
e9041c0697
2 changed files with 18 additions and 0 deletions
|
@ -1748,6 +1748,23 @@ void PArray::SetPointer(void *base, unsigned offset, TArray<size_t> *special)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// PArray :: SetPointerArray
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
void PArray::SetPointerArray(void *base, unsigned offset, TArray<size_t> *special)
|
||||||
|
{
|
||||||
|
if (ElementType->isStruct())
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < ElementCount; ++i)
|
||||||
|
{
|
||||||
|
ElementType->SetPointerArray(base, offset + ElementSize * i, special);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// NewArray
|
// NewArray
|
||||||
|
|
|
@ -485,6 +485,7 @@ public:
|
||||||
|
|
||||||
void SetDefaultValue(void *base, unsigned offset, TArray<FTypeAndOffset> *special) override;
|
void SetDefaultValue(void *base, unsigned offset, TArray<FTypeAndOffset> *special) override;
|
||||||
void SetPointer(void *base, unsigned offset, TArray<size_t> *special) override;
|
void SetPointer(void *base, unsigned offset, TArray<size_t> *special) override;
|
||||||
|
void SetPointerArray(void *base, unsigned offset, TArray<size_t> *ptrofs = NULL) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PStaticArray : public PArray
|
class PStaticArray : public PArray
|
||||||
|
|
Loading…
Reference in a new issue