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_use_icons = (icons != NULL);
|
||||||
m_icons = icons;
|
m_icons = icons;
|
||||||
|
|
||||||
|
CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
|
||||||
|
assert(list != NULL);
|
||||||
|
|
||||||
if (m_use_icons)
|
if (m_use_icons)
|
||||||
{
|
{
|
||||||
CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
|
|
||||||
assert(list != NULL);
|
|
||||||
|
|
||||||
list->setSpriteBank(m_icons);
|
list->setSpriteBank(m_icons);
|
||||||
|
|
||||||
// determine needed height
|
// determine needed height
|
||||||
@ -83,6 +83,10 @@ void ListWidget::setIcons(STKModifiedSpriteBank* icons, int size)
|
|||||||
list->setItemHeight( item_height );
|
list->setItemHeight( item_height );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list->setSpriteBank(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ GhostReplaySelection::~GhostReplaySelection()
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void GhostReplaySelection::tearDown()
|
void GhostReplaySelection::tearDown()
|
||||||
{
|
{
|
||||||
|
m_replay_list_widget->setIcons(NULL);
|
||||||
delete m_icon_bank;
|
delete m_icon_bank;
|
||||||
m_icon_bank = NULL;
|
m_icon_bank = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user