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; }