wait on the SendQueue thread in Connection

This commit is contained in:
Stephen Birarda 2015-08-18 09:40:13 -07:00
parent 4e540828bd
commit 426a8909e1

View file

@ -47,9 +47,16 @@ Connection::Connection(Socket* parentSocket, HifiSockAddr destination, std::uniq
Connection::~Connection() {
if (_sendQueue) {
// grab the send queue thread so we can wait on it
QThread* sendQueueThread = _sendQueue->thread();
// tell the send queue to stop and be deleted
_sendQueue->stop();
_sendQueue->deleteLater();
_sendQueue.release();
// wait on the send queue thread so we know the send queue is gone
sendQueueThread->wait();
}
}