Fix crash when leaving ghost replay screen
This commit is contained in:
parent
418901b0de
commit
817b576399
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ GhostReplaySelection::~GhostReplaySelection()
|
||||
// ----------------------------------------------------------------------------
|
||||
void GhostReplaySelection::tearDown()
|
||||
{
|
||||
m_replay_list_widget->setIcons(NULL);
|
||||
delete m_icon_bank;
|
||||
m_icon_bank = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user