added missing mutex to protect Icon Cache

This commit is contained in:
csoler 2019-06-06 14:21:19 +02:00
parent 2720022163
commit d9b0fa6c61

View File

@ -398,6 +398,7 @@ const QPixmap GxsIdDetails::makeDefaultIcon(const RsGxsId& id, AvatarSize size)
// now look for the icon
QMutexLocker lock(&mInstance->mMutex);
auto& it = mDefaultIconCache[id];
if(it[(int)size].second.width() > 0)
@ -437,6 +438,8 @@ void GxsIdDetails::checkCleanImagesCache()
uint32_t size_deleted = 0;
uint32_t total_size = 0;
QMutexLocker lock(&mInstance->mMutex);
for(auto it(mDefaultIconCache.begin());it!=mDefaultIconCache.end();)
{
bool all_empty = true ;
@ -489,6 +492,8 @@ bool GxsIdDetails::loadPixmapFromData(const unsigned char *data,size_t data_len,
// now look for the icon
QMutexLocker lock(&mInstance->mMutex);
time_t now = time(NULL);
auto& it = mDefaultIconCache[id];