Fix memory leak in pixmap disk cache

This commit is contained in:
Mark Furneaux 2014-05-28 17:30:07 -04:00
parent b2bd7828c4
commit b463f32459
1 changed files with 2 additions and 1 deletions

View File

@ -508,7 +508,8 @@ void LibraryModel::AlbumArtLoaded(quint64 id, const QImage& image) {
}
// if not already in the disk cache
if (!icon_cache_->data(QUrl(cache_key))) {
std::unique_ptr<QIODevice> cached_img (icon_cache_->data(QUrl(cache_key)));
if (!cached_img) {
QNetworkCacheMetaData item_metadata;
item_metadata.setSaveToDisk(true);
item_metadata.setUrl(QUrl(cache_key));