Fix crash when leaving ghost replay screen

This commit is contained in:
auria.mg 2018-08-26 21:07:56 -04:00
parent 418901b0de
commit 817b576399
2 changed files with 8 additions and 3 deletions

View File

@ -54,11 +54,11 @@ void ListWidget::setIcons(STKModifiedSpriteBank* icons, int size)
m_use_icons = (icons != NULL);
m_icons = icons;
CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
assert(list != NULL);
if (m_use_icons)
{
CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
assert(list != NULL);
list->setSpriteBank(m_icons);
// determine needed height
@ -83,6 +83,10 @@ void ListWidget::setIcons(STKModifiedSpriteBank* icons, int size)
list->setItemHeight( item_height );
}
}
else
{
list->setSpriteBank(NULL);
}
}

View File

@ -50,6 +50,7 @@ GhostReplaySelection::~GhostReplaySelection()
// ----------------------------------------------------------------------------
void GhostReplaySelection::tearDown()
{
m_replay_list_widget->setIcons(NULL);
delete m_icon_bank;
m_icon_bank = NULL;
}