aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-09-19 12:29:10 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-20 08:47:27 +0200
commit940069e463b149cee85a88f33d26ace46d16ec59 (patch)
tree9b052b8aeb80a6d2f30825d61567f14f97b2b9b1 /src/plugins
parent4bca5b2ff803f4d09350e2d251c90e3b9d60f350 (diff)
QDeclarativeDebug: Allow reconnects to QML debugger port
Allow a new client to attach once the old one was disconnected. Done by Aurindam Jana. Change-Id: Id85045204cc011ec6e02db2658173e652b75c07e Reviewed-on: http://codereview.qt-project.org/5132 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index abc60e13a7..512ea6571d 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -168,13 +168,14 @@ void QTcpServerConnection::newConnection()
{
Q_D(QTcpServerConnection);
- if (d->socket) {
+ if (d->socket && d->socket->peerPort()) {
qWarning("QDeclarativeDebugServer: Another client is already connected");
QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection();
delete faultyConnection;
return;
}
+ delete d->socket;
d->socket = d->tcpServer->nextPendingConnection();
d->socket->setParent(this);
d->protocol = new QPacketProtocol(d->socket, this);