mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
added missing mutex to protect Icon Cache
This commit is contained in:
parent
2720022163
commit
d9b0fa6c61
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user