Release send queue before cleanup

This commit is contained in:
Atlante45 2015-09-22 15:11:17 +02:00
parent 290a0e573d
commit 709dab6beb

View file

@ -52,15 +52,14 @@ Connection::~Connection() {
}
void Connection::stopSendQueue() {
if (_sendQueue) {
if (auto sendQueue = _sendQueue.release()) {
// grab the send queue thread so we can wait on it
QThread* sendQueueThread = _sendQueue->thread();
QThread* sendQueueThread = sendQueue->thread();
// tell the send queue to stop and be deleted
_sendQueue->stop();
_sendQueue->deleteLater();
_sendQueue.release();
sendQueue->stop();
sendQueue->deleteLater();
// since we're stopping the send queue we should consider our handshake ACK not receieved
_hasReceivedHandshakeACK = false;