diff options
author | Aurindam Jana <aurindam.jana@nokia.com> | 2011-11-24 13:14:21 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-24 15:02:58 +0100 |
commit | 2e03531bfb27fe4072d9d33b3ae422bba1c8c09b (patch) | |
tree | 83b6c9b5d516e6f03f95e4e025411c8b2f1af30e | |
parent | 2316fbb6cc190ea4ace2b5b6359e5940df28b84b (diff) |
QDeclarativeDebugService: Crash fix
Query for serviceNames in registerService.
Change-Id: I570bd68c424cec696ca813a7fa1b485b64e328a4
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
-rw-r--r-- | src/declarative/debugger/qdeclarativedebugservice.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp index 0a997aa2fe..2bdcf2ff92 100644 --- a/src/declarative/debugger/qdeclarativedebugservice.cpp +++ b/src/declarative/debugger/qdeclarativedebugservice.cpp @@ -61,10 +61,7 @@ QDeclarativeDebugService::QDeclarativeDebugService(const QString &name, QObject d->server = QDeclarativeDebugServer::instance(); d->status = QDeclarativeDebugService::NotConnected; - if (d->server->serviceNames().contains(d->name)) { - qWarning() << "QDeclarativeDebugService: Conflicting plugin name" << d->name; - d->server = 0; - } + } QDeclarativeDebugService::QDeclarativeDebugService(QDeclarativeDebugServicePrivate &dd, @@ -87,7 +84,12 @@ QDeclarativeDebugService::Status QDeclarativeDebugService::registerService() if (!d->server) return NotConnected; - d->server->addService(this); + if (d->server->serviceNames().contains(d->name)) { + qWarning() << "QDeclarativeDebugService: Conflicting plugin name" << d->name; + d->server = 0; + } else { + d->server->addService(this); + } return status(); } |