Commit b78896d6 authored by Max Kellermann's avatar Max Kellermann

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

Assigning nullptr to next_song may disrupt the player thread and render undefined behavior.
parent e753c924
...@@ -227,7 +227,11 @@ PlayerControl::Seek(DetachedSong *song, SongTime t) ...@@ -227,7 +227,11 @@ PlayerControl::Seek(DetachedSong *song, SongTime t)
Lock(); Lock();
delete next_song; if (next_song != nullptr)
SynchronousCommand(PlayerCommand::CANCEL);
assert(next_song == nullptr);
next_song = song; next_song = song;
seek_time = t; seek_time = t;
SynchronousCommand(PlayerCommand::SEEK); SynchronousCommand(PlayerCommand::SEEK);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment