- Check if Queue is empty before sending next song.
- Changed the way the queue is deleted after client disconnects.
This commit is contained in:
parent
66eff922d8
commit
d1da0159e2
@ -145,8 +145,7 @@ void OutgoingDataCreator::SendDataToClients(pb::remote::Message* msg) {
|
||||
if (client->State() != QTcpSocket::ConnectedState) {
|
||||
clients_->removeAt(clients_->indexOf(client));
|
||||
if (download_queue_.contains(client)) {
|
||||
delete download_queue_.value(client);
|
||||
download_queue_.remove(client);
|
||||
delete download_queue_.take(client);
|
||||
}
|
||||
delete client;
|
||||
}
|
||||
@ -584,6 +583,9 @@ void OutgoingDataCreator::SendNextSong(RemoteClient *client) {
|
||||
if (!download_queue_.contains(client))
|
||||
return;
|
||||
|
||||
if (download_queue_.value(client)->isEmpty())
|
||||
return;
|
||||
|
||||
// Get the item and send the single song
|
||||
DownloadItem item;
|
||||
item = download_queue_.value(client)->dequeue();
|
||||
|
Loading…
x
Reference in New Issue
Block a user