Fix crash when searching in element search ui
This commit is contained in:
parent
e1d32c9352
commit
711453ad65
@ -95,9 +95,9 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
|
|||||||
void ElementSearchActivity::searchTools(String query)
|
void ElementSearchActivity::searchTools(String query)
|
||||||
{
|
{
|
||||||
firstResult = NULL;
|
firstResult = NULL;
|
||||||
for(std::vector<ToolButton*>::iterator iter = toolButtons.begin(), end = toolButtons.end(); iter != end; ++iter) {
|
for (auto &toolButton : toolButtons) {
|
||||||
delete *iter;
|
RemoveComponent(toolButton);
|
||||||
RemoveComponent(*iter);
|
delete toolButton;
|
||||||
}
|
}
|
||||||
toolButtons.clear();
|
toolButtons.clear();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user