From 7a11be86150422174cd7d745ba5b8fe55d44c686 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 16 Apr 2018 14:44:45 +0300 Subject: [PATCH] Fixed dangling links to garbage collected HUD message objects https://forum.zdoom.org/viewtopic.php?t=60262 --- src/g_statusbar/shared_sbar.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index 6ea45eda5..83347c2f4 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -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)