diff --git a/src/app/ui/resources_listbox.cpp b/src/app/ui/resources_listbox.cpp index 223b9de56..52ee7b935 100644 --- a/src/app/ui/resources_listbox.cpp +++ b/src/app/ui/resources_listbox.cpp @@ -177,22 +177,20 @@ void ResourcesListBox::onTick() base::UniquePtr resource; std::string name; - if (!m_resourcesLoader->next(resource)) { - if (m_resourcesLoader->isDone()) { - stop(); - } - return; + while (m_resourcesLoader->next(resource)) { + base::UniquePtr listItem(onCreateResourceItem(resource)); + insertChild(getItemsCount()-1, listItem); + layout(); + + if (View* view = View::getView(this)) + view->updateView(); + + resource.release(); + listItem.release(); } - base::UniquePtr listItem(onCreateResourceItem(resource)); - insertChild(getItemsCount()-1, listItem); - layout(); - - if (View* view = View::getView(this)) - view->updateView(); - - resource.release(); - listItem.release(); + if (m_resourcesLoader->isDone()) + stop(); } void ResourcesListBox::stop()