From a5f1cec896c514a94f243f4adf3660e4b03a41ef Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Tue, 8 May 2012 14:21:45 +0200 Subject: QmlDebugging: make sure that all data is sent on close Change-Id: I662a3865fec1e4d12d57389bfbe23d7221b6df16 Reviewed-by: Aurindam Jana Reviewed-by: Kai Koehne --- src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp index 724155a8f5..e747a8d179 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp +++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp @@ -82,6 +82,8 @@ QTcpServerConnection::QTcpServerConnection() : QTcpServerConnection::~QTcpServerConnection() { + if (isConnected()) + disconnect(); delete d_ptr; } @@ -117,6 +119,9 @@ void QTcpServerConnection::disconnect() { Q_D(QTcpServerConnection); + while (d->socket && d->socket->bytesToWrite() > 0) + d->socket->waitForBytesWritten(); + // protocol might still be processing packages at this point d->protocol->deleteLater(); d->protocol = 0; -- cgit v1.2.3