Dont return from SongSaveComplete early, needs to free TagReaderReply

This commit is contained in:
Jonas Kvinge 2020-11-09 19:17:31 +01:00
parent bbdec92dc6
commit 73c7024e11
1 changed files with 4 additions and 3 deletions

View File

@ -403,9 +403,10 @@ void Playlist::SongSaveComplete(TagReaderReply *reply, const QPersistentModelInd
if (reply->is_successful() && idx.isValid()) {
if (reply->message().save_file_response().success()) {
PlaylistItemPtr item = item_at(idx.row());
if (!item) return;
QFuture<void> future = item->BackgroundReload();
NewClosure(future, this, SLOT(ItemReloadComplete(QPersistentModelIndex)), idx);
if (item) {
QFuture<void> future = item->BackgroundReload();
NewClosure(future, this, SLOT(ItemReloadComplete(QPersistentModelIndex)), idx);
}
}
else {
emit Error(tr("An error occurred writing metadata to '%1'").arg(QString::fromStdString(reply->request_message().save_file_request().filename())));