aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-10-23 16:01:06 +0200
committerUlf Hermann <ulf.hermann@digia.com>2014-10-24 10:01:50 +0200
commit01cdb04ad579f9105694556062d83d61253aa23f (patch)
treeb6eb4a955d084a5c22ade562cb94de7555a056d1 /src
parent0f65f30cf463c98ded6074751b525e34eb2a73e9 (diff)
Stop waiting in QTcpServerConnection if waitForBytesWritten fails
There is no point in waiting any further for the remaining bytes to be written as it will never succeed. We might get luckier by creating a local event loop and repeatedly calling processEvents(), but as that is considerably worse style and because you shouldn't rely on the connection to send on exit anyway we don't do that. Task-number: QTBUG-42158, see also QTBUG-24451 Change-Id: I79ffd5f5a4a7c41ff8dc0c4f6f1ca7e091844c9d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index 55981ffa50..4388fa7eb1 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -113,8 +113,13 @@ void QTcpServerConnection::disconnect()
{
Q_D(QTcpServerConnection);
- while (d->socket && d->socket->bytesToWrite() > 0)
- d->socket->waitForBytesWritten();
+ while (d->socket && d->socket->bytesToWrite() > 0) {
+ if (!d->socket->waitForBytesWritten()) {
+ qWarning("QML Debugger: Failed to send remaining %lld bytes on disconnect.",
+ d->socket->bytesToWrite());
+ break;
+ }
+ }
// protocol might still be processing packages at this point
d->protocol->deleteLater();