- fixed: Takedown of an expired HUD message did not properly detach it from the list.

This commit is contained in:
Christoph Oelckers 2019-08-09 08:32:23 +02:00
parent d1026e4b5b
commit 8447525019

View file

@ -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<DHUDMessageBase *>*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;
}