Skip to content

Commit 2d551e6

Browse files
committed
- Blood: add all statically stored EventObjects to the GC processor.
1 parent a9ad2a3 commit 2d551e6

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

source/core/shared_hud.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ void CreateAltHUD()
138138
{
139139
if (AltHud)
140140
{
141-
GC::DelSoftRoot(AltHud);
142141
AltHud->Destroy();
143142
AltHud = nullptr;
144143
}
@@ -152,7 +151,7 @@ void CreateAltHUD()
152151
AltHud = DoCreateAltHUD(NAME_AltHud);
153152

154153
assert(AltHud);
155-
GC::AddSoftRoot(AltHud);
154+
GC::AddMarkerFunc([]() { GC::Mark(AltHud); });
156155
}
157156

158157

source/games/blood/src/blood.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4848
#include "texturemanager.h"
4949
#include "statusbar.h"
5050
#include "vm.h"
51+
#include "nnexts.h"
5152

5253
BEGIN_BLD_NS
5354

@@ -74,6 +75,8 @@ IMPLEMENT_POINTERS_END
7475
//
7576
//---------------------------------------------------------------------------
7677
void MarkSprInSect();
78+
void MarkSeq();
79+
7780

7881
size_t DBloodActor::PropagateMark()
7982
{
@@ -101,6 +104,15 @@ static void markgcroots()
101104
GC::Mark(pl.fragger);
102105
GC::Mark(pl.voodooTarget);
103106
}
107+
for (auto& evobj : rxBucket)
108+
{
109+
evobj.Mark();
110+
}
111+
for (auto& cond : gConditions)
112+
{
113+
for (auto& obj : cond.objects) obj.obj.Mark();
114+
}
115+
MarkSeq();
104116
}
105117

106118

source/games/blood/src/eventq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ enum {
118118
kChannelMax = 4096,
119119
};
120120

121-
extern EventObject rxBucket[];
121+
extern EventObject rxBucket[kChannelMax];
122122
extern unsigned short bucketHead[];
123123

124124
enum COMMAND_ID {

source/games/blood/src/seq.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,20 @@ struct ActiveList
464464
remove(SS_SPRITE, EventObject(actor));
465465
}
466466

467+
void Mark()
468+
{
469+
for (auto& seqinst : list) seqinst.target.Mark();
470+
}
471+
467472
};
468473

469474
static ActiveList activeList;
470475

476+
void MarkSeq()
477+
{
478+
activeList.Mark();
479+
}
480+
471481
//---------------------------------------------------------------------------
472482
//
473483
//

0 commit comments

Comments
 (0)