player/Control: use CANCEL to clear next_song in Seek()

Assigning nullptr to next_song may disrupt the player thread and
render undefined behavior.
This commit is contained in:
Max Kellermann 2015-10-27 23:09:03 +01:00
parent e753c924ef
commit b78896d64e

View File

@ -227,7 +227,11 @@ PlayerControl::Seek(DetachedSong *song, SongTime t)
Lock();
delete next_song;
if (next_song != nullptr)
SynchronousCommand(PlayerCommand::CANCEL);
assert(next_song == nullptr);
next_song = song;
seek_time = t;
SynchronousCommand(PlayerCommand::SEEK);