From 84475250192dd4274c5a09e35047db6ac21a3c04 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2019 08:32:23 +0200 Subject: [PATCH] - fixed: Takedown of an expired HUD message did not properly detach it from the list. --- src/g_statusbar/shared_sbar.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index aec788b56..7cc9e262c 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -460,6 +460,7 @@ void DBaseStatusBar::OnDestroy () while (msg) { DHUDMessageBase *next = msg->Next; + msg->Next = nullptr; msg->Destroy(); msg = next; } @@ -745,7 +746,6 @@ void DBaseStatusBar::Tick () for (size_t i = 0; i < countof(Messages); ++i) { DHUDMessageBase *msg = Messages[i]; - TObjPtr*prev = &Messages[i]; while (msg) { @@ -753,13 +753,9 @@ void DBaseStatusBar::Tick () if (msg->CallTick ()) { - *prev = next; + DetachMessage(msg); msg->Destroy(); } - else - { - prev = &msg->Next; - } msg = next; }