mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Fixed dangling links to garbage collected HUD message objects
https://forum.zdoom.org/viewtopic.php?t=60262
This commit is contained in:
parent
df634539a0
commit
7a11be8615
1 changed files with 1 additions and 3 deletions
|
@ -658,7 +658,6 @@ void DBaseStatusBar::AttachMessage (DHUDMessageBase *msg, uint32_t id, int layer
|
|||
{
|
||||
DHUDMessageBase *old = NULL;
|
||||
DHUDMessageBase **prev;
|
||||
DObject *container = this;
|
||||
|
||||
old = (id == 0 || id == 0xFFFFFFFF) ? NULL : DetachMessage (id);
|
||||
if (old != NULL)
|
||||
|
@ -679,14 +678,13 @@ void DBaseStatusBar::AttachMessage (DHUDMessageBase *msg, uint32_t id, int layer
|
|||
// it gets drawn back to front.)
|
||||
while (*prev != NULL && (*prev)->SBarID > id)
|
||||
{
|
||||
container = *prev;
|
||||
prev = &(*prev)->Next;
|
||||
}
|
||||
|
||||
msg->Next = *prev;
|
||||
msg->SBarID = id;
|
||||
*prev = msg;
|
||||
GC::WriteBarrier(container, msg);
|
||||
GC::WriteBarrier(msg);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DBaseStatusBar, AttachMessage)
|
||||
|
|
Loading…
Reference in a new issue