Always call QFutureWatcher::setFuture after connects
This commit is contained in:
@@ -396,11 +396,11 @@ bool OrganizeDialog::SetFilenames(const QStringList &filenames) {
|
||||
songs_future_ = QtConcurrent::run(this, &OrganizeDialog::LoadSongsBlocking, filenames);
|
||||
#endif
|
||||
QFutureWatcher<SongList> *watcher = new QFutureWatcher<SongList>();
|
||||
watcher->setFuture(songs_future_);
|
||||
QObject::connect(watcher, &QFutureWatcher<SongList>::finished, this, [this, watcher]() {
|
||||
SetSongs(watcher->result());
|
||||
watcher->deleteLater();
|
||||
});
|
||||
watcher->setFuture(songs_future_);
|
||||
|
||||
SetLoadingSongs(true);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user