diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2010-09-28 10:24:55 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-10-04 04:49:48 (GMT) |
commit | 69a39d7b48ef239248d1039a2d8f2f0dbf560b34 (patch) | |
tree | 77a8558e174895e094fb9bd272f03d6c06251293 | |
parent | a506b183332f313a9a197d5fd7359153eb1728c8 (diff) | |
download | Qt-69a39d7b48ef239248d1039a2d8f2f0dbf560b34.zip Qt-69a39d7b48ef239248d1039a2d8f2f0dbf560b34.tar.gz Qt-69a39d7b48ef239248d1039a2d8f2f0dbf560b34.tar.bz2 |
QmlDebugService: Check that there is a receiver before sending messages
Reviewed-by: Christiaan Janssen
(cherry picked from commit 30959e88498b2c8591145e30c8b497a76c12d8f6)
-rw-r--r-- | src/declarative/debugger/qdeclarativedebugservice.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp index 0fbc1e3..62f2f39 100644 --- a/src/declarative/debugger/qdeclarativedebugservice.cpp +++ b/src/declarative/debugger/qdeclarativedebugservice.cpp @@ -182,7 +182,9 @@ void QDeclarativeDebugServer::newConnection() bool QDeclarativeDebugServer::hasDebuggingClient() const { Q_D(const QDeclarativeDebugServer); - return d->gotHello; + return d->connection + && (d->connection->state() == QTcpSocket::ConnectedState) + && d->gotHello; } QDeclarativeDebugServer *QDeclarativeDebugServer::instance() @@ -485,7 +487,7 @@ void QDeclarativeDebugService::sendMessage(const QByteArray &message) { Q_D(QDeclarativeDebugService); - if (!d->server || !d->server->d_func()->connection) + if (status() != Enabled) return; QPacket pack; |