mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Add OF_Transient flag for objects that shouldn't be written to disk
This commit is contained in:
parent
162da2fcaf
commit
58ec0e4594
2 changed files with 5 additions and 1 deletions
|
@ -201,6 +201,7 @@ enum EObjectFlags
|
|||
OF_EuthanizeMe = 1 << 5, // Object wants to die
|
||||
OF_Cleanup = 1 << 6, // Object is now being deleted by the collector
|
||||
OF_YesReallyDelete = 1 << 7, // Object is being deleted outside the collector, and this is okay, so don't print a warning
|
||||
OF_Transient = 1 << 11, // Object should not be archived (references to it will be nulled on disk)
|
||||
|
||||
OF_WhiteBits = OF_White0 | OF_White1,
|
||||
OF_MarkBits = OF_WhiteBits | OF_Black,
|
||||
|
@ -573,6 +574,9 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
// When you write to a pointer to an Object, you must call this for
|
||||
// proper bookkeeping in case the Object holding this pointer has
|
||||
// already been processed by the GC.
|
||||
static inline void GC::WriteBarrier(DObject *pointing, DObject *pointed)
|
||||
{
|
||||
if (pointed != NULL && pointed->IsWhite() && pointing->IsBlack())
|
||||
|
|
|
@ -1451,7 +1451,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, DObject *&value, DObje
|
|||
{
|
||||
ndx = -1;
|
||||
}
|
||||
else if (value->ObjectFlags & OF_EuthanizeMe)
|
||||
else if (value->ObjectFlags & (OF_EuthanizeMe | OF_Transient))
|
||||
{
|
||||
return arc;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue