added a test for QImage::isDetached() in cache to solve the problem of whether a cache image is still used or not

This commit is contained in:
csoler 2019-03-23 22:59:37 +01:00
parent ae3f81a0c3
commit 2ad641d908
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -472,7 +472,7 @@ const QImage& GxsIdDetails::makeDefaultIcon(const RsGxsId& id)
int nb_deleted = 0;
for(auto it(mDefaultIconCache.begin());it!=mDefaultIconCache.end();)
if(it->second.first + ICON_CACHE_STORAGE_TIME < now)
if(it->second.first + ICON_CACHE_STORAGE_TIME < now && it->second.second.isDetached())
{
it = mDefaultIconCache.erase(it);
++nb_deleted;