Attempt to fix MessageReply crash when saving tags

This commit is contained in:
Jonas Kvinge 2019-06-22 08:36:02 +02:00
parent 5bd5cdf435
commit 10dc725942
3 changed files with 6 additions and 4 deletions

View File

@ -1728,10 +1728,12 @@ void MainWindow::RenumberTracks() {
}
void MainWindow::SongSaveComplete(TagReaderReply *reply, const QPersistentModelIndex &index) {
if (reply->is_successful() && index.isValid()) {
app_->playlist_manager()->current()->ReloadItems(QList<int>()<< index.row());
}
reply->deleteLater();
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
}
void MainWindow::SelectionSetValue() {

View File

@ -894,8 +894,6 @@ void EditTagDialog::FetchTagSongChosen(const Song &original_song, const Song &ne
void EditTagDialog::SongSaveComplete(TagReaderReply *reply, const QString filename, const Song song) {
reply->deleteLater();
pending_--;
if (!reply->message().save_file_response().success()) {
@ -910,4 +908,6 @@ void EditTagDialog::SongSaveComplete(TagReaderReply *reply, const QString filena
if (pending_ <= 0) AcceptFinished();
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
}

View File

@ -400,7 +400,7 @@ void Playlist::SongSaveComplete(TagReaderReply *reply, const QPersistentModelInd
}
}
reply->deleteLater();
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
}