Merge pull request #4383 from TheUbuntuGuy/libcache

Fix memory leak in pixmap disk cache
This commit is contained in:
David Sansome 2014-05-29 07:57:41 +10:00
commit c8661541a4
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));