Check that QIODevice::open() is successful, and explicitly call close()
This commit is contained in:
@@ -1240,7 +1240,7 @@ QMimeData *Playlist::mimeData(const QModelIndexList &indexes) const {
|
||||
}
|
||||
|
||||
QBuffer buf;
|
||||
buf.open(QIODevice::WriteOnly);
|
||||
if (!buf.open(QIODevice::WriteOnly)) return nullptr;
|
||||
QDataStream stream(&buf);
|
||||
|
||||
const Playlist *self = this;
|
||||
|
||||
@@ -294,6 +294,7 @@ PlaylistItemPtr PlaylistBackend::RestoreCueData(PlaylistItemPtr item, std::share
|
||||
if (!cue_file.open(QIODevice::ReadOnly)) return item;
|
||||
|
||||
song_list = cue_parser.Load(&cue_file, cue_path, QDir(cue_path.section('/', 0, -2)));
|
||||
cue_file.close();
|
||||
state->cached_cues_[cue_path] = song_list;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user