Skip to content

Commit

Permalink
Fixed dangling links to garbage collected HUD message objects
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Apr 16, 2018
1 parent df63453 commit 7a11be8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/g_statusbar/shared_sbar.cpp
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 7a11be8

Please sign in to comment.