From b0fe8535fdee0129503262c3187b68ddbe1dbf8e Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Mon, 21 Sep 2015 17:17:29 +0200 Subject: [PATCH] Release _sendQueue before cleanup --- libraries/networking/src/udt/Connection.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/networking/src/udt/Connection.cpp b/libraries/networking/src/udt/Connection.cpp index e8b22f6ab8..d7b851fcf4 100644 --- a/libraries/networking/src/udt/Connection.cpp +++ b/libraries/networking/src/udt/Connection.cpp @@ -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;