BtLocalDevice::~BtLocalDevice() { while (!serverSockets.isEmpty()) { QBluetoothSocket* s = serverSockets.takeFirst(); s->abort(); s->deleteLater(); } }
//! [clientDisconnected] void ChatServer::clientDisconnected() { QBluetoothSocket *socket = qobject_cast<QBluetoothSocket *>(sender()); if (!socket) return; emit clientDisconnected(socket->peerName()); clientSockets.removeOne(socket); socket->deleteLater(); }