client/Expire: cancel the BackgroundCommand before deleting it
Fixes assertion failure. Closes https://github.com/MusicPlayerDaemon/MPD/issues/774
This commit is contained in:
parent
f24c274f5c
commit
2229e86673
|
@ -28,7 +28,10 @@ Client::SetExpired() noexcept
|
|||
if (IsExpired())
|
||||
return;
|
||||
|
||||
background_command.reset();
|
||||
if (background_command) {
|
||||
background_command->Cancel();
|
||||
background_command.reset();
|
||||
}
|
||||
|
||||
FullyBufferedSocket::Close();
|
||||
timeout_event.Schedule(std::chrono::steady_clock::duration::zero());
|
||||
|
|
Loading…
Reference in New Issue