- Blood: add all statically stored EventObjects to the GC processor.

This commit is contained in:
Christoph Oelckers 2022-12-18 17:48:25 +01:00
parent b1e2b2addf
commit ef7c72ce9f
4 changed files with 24 additions and 3 deletions

View file

@ -138,7 +138,6 @@ void CreateAltHUD()
{
if (AltHud)
{
GC::DelSoftRoot(AltHud);
AltHud->Destroy();
AltHud = nullptr;
}
@ -152,7 +151,7 @@ void CreateAltHUD()
AltHud = DoCreateAltHUD(NAME_AltHud);
assert(AltHud);
GC::AddSoftRoot(AltHud);
GC::AddMarkerFunc([]() { GC::Mark(AltHud); });
}

View file

@ -49,6 +49,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "statusbar.h"
#include "vm.h"
#include "tilesetbuilder.h"
#include "nnexts.h"
BEGIN_BLD_NS
@ -75,6 +76,8 @@ IMPLEMENT_POINTERS_END
//
//---------------------------------------------------------------------------
void MarkSprInSect();
void MarkSeq();
size_t DBloodActor::PropagateMark()
{
@ -102,6 +105,15 @@ static void markgcroots()
GC::Mark(pl.fragger);
GC::Mark(pl.voodooTarget);
}
for (auto& evobj : rxBucket)
{
evobj.Mark();
}
for (auto& cond : gConditions)
{
for (auto& obj : cond.objects) obj.obj.Mark();
}
MarkSeq();
}

View file

@ -118,7 +118,7 @@ enum {
kChannelMax = 4096,
};
extern EventObject rxBucket[];
extern EventObject rxBucket[kChannelMax];
extern unsigned short bucketHead[];
enum COMMAND_ID {

View file

@ -468,10 +468,20 @@ struct ActiveList
remove(SS_SPRITE, EventObject(actor));
}
void Mark()
{
for (auto& seqinst : list) seqinst.target.Mark();
}
};
static ActiveList activeList;
void MarkSeq()
{
activeList.Mark();
}
//---------------------------------------------------------------------------
//
//