Make sure icon handling of addons is thread safe

This commit is contained in:
Benau 2019-12-20 09:55:12 +08:00
parent dce9bf1e63
commit fe0cb90769

View File

@ -290,10 +290,9 @@ void AddonsManager::initAddons(const XMLNode *xml)
}
m_addons_list.unlock();
m_state.setAtomic(STATE_READY);
if (UserConfigParams::m_internet_status == RequestManager::IPERM_ALLOWED)
downloadIcons();
m_state.setAtomic(STATE_READY);
} // initAddons
// ----------------------------------------------------------------------------
@ -391,12 +390,9 @@ void AddonsManager::downloadIcons()
class IconRequest : public Online::HTTPRequest
{
Addon *m_addon; // stores this addon object
void afterOperation()
{
m_addon->setIconReady();
} // afterOperation
void callback()
{
m_addon->setIconReady();
if (!hadDownloadError())
addons_manager->m_downloaded_icons = true;
} // callback