delay deleting save buttons, to prevent possible crash later

This commit is contained in:
jacob1 2013-01-07 10:52:06 -05:00
parent 4aaf3b852e
commit 659c3677aa
2 changed files with 6 additions and 3 deletions

View File

@ -517,9 +517,7 @@ void SearchView::NotifySaveListChanged(SearchModel * sender)
for(i = 0; i < saveButtons.size(); i++)
{
RemoveComponent(saveButtons[i]);
delete saveButtons[i];
}
saveButtons.clear();
if(!sender->GetSavesLoaded())
{
nextButton->Enabled = false;
@ -574,6 +572,11 @@ void SearchView::NotifySaveListChanged(SearchModel * sender)
delete errorLabel;
errorLabel = NULL;
}
for(i = 0; i < saveButtons.size(); i++)
{
delete saveButtons[i];
}
saveButtons.clear();
buttonYOffset = 28;
buttonXOffset = buttonPadding;

View File

@ -24,7 +24,7 @@ public:
std::string GetError();
std::string GetStatus();
void Poll();
Task() : listener(NULL) { progress = 0; }
Task() : listener(NULL) { progress = 0; thProgress = 0; }
virtual ~Task();
protected:
int progress;