summaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2009-08-13 14:15:33 (GMT)
committerKai Koehne <kai.koehne@nokia.com>2009-08-13 14:19:53 (GMT)
commit3f33780398e4147f8ebb5130617d443e0ce1476f (patch)
treef5632c8d0295dedeb620b9f5b4779da07f62e26f /src/declarative/debugger
parentdb22c1a7a9c5e6a9d443c8fde767cbab98c6ec5f (diff)
downloadQt-3f33780398e4147f8ebb5130617d443e0ce1476f.zip
Qt-3f33780398e4147f8ebb5130617d443e0ce1476f.tar.gz
Qt-3f33780398e4147f8ebb5130617d443e0ce1476f.tar.bz2
Fix crash on exit when using the qml debugging interface
QmlEngineDebugClient is defined as a member variable AND the object parent is set -> double deletion.
Diffstat (limited to 'src/declarative/debugger')
-rw-r--r--src/declarative/debugger/qmldebug.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp
index 9397bb9..57e5858 100644
--- a/src/declarative/debugger/qmldebug.cpp
+++ b/src/declarative/debugger/qmldebug.cpp
@@ -23,7 +23,7 @@ public:
void message(const QByteArray &);
- QmlEngineDebugClient client;
+ QmlEngineDebugClient *client;
int nextId;
int getId();
@@ -51,7 +51,7 @@ void QmlEngineDebugClient::messageReceived(const QByteArray &data)
}
QmlEngineDebugPrivate::QmlEngineDebugPrivate(QmlDebugConnection *c)
-: client(c, this), nextId(0)
+: client(new QmlEngineDebugClient(c, this)), nextId(0)
{
}
@@ -247,7 +247,7 @@ QmlDebugEnginesQuery *QmlEngineDebug::queryAvailableEngines(QObject *parent)
Q_D(QmlEngineDebug);
QmlDebugEnginesQuery *query = new QmlDebugEnginesQuery(parent);
- if (d->client.isConnected()) {
+ if (d->client->isConnected()) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
@@ -256,7 +256,7 @@ QmlDebugEnginesQuery *QmlEngineDebug::queryAvailableEngines(QObject *parent)
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("LIST_ENGINES") << queryId;
- d->client.sendMessage(message);
+ d->client->sendMessage(message);
} else {
query->m_state = QmlDebugQuery::Error;
}
@@ -269,7 +269,7 @@ QmlDebugRootContextQuery *QmlEngineDebug::queryRootContexts(const QmlDebugEngine
Q_D(QmlEngineDebug);
QmlDebugRootContextQuery *query = new QmlDebugRootContextQuery(parent);
- if (d->client.isConnected() && engine.debugId() != -1) {
+ if (d->client->isConnected() && engine.debugId() != -1) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
@@ -278,7 +278,7 @@ QmlDebugRootContextQuery *QmlEngineDebug::queryRootContexts(const QmlDebugEngine
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId();
- d->client.sendMessage(message);
+ d->client->sendMessage(message);
} else {
query->m_state = QmlDebugQuery::Error;
}
@@ -291,7 +291,7 @@ QmlDebugObjectQuery *QmlEngineDebug::queryObject(const QmlDebugObjectReference &
Q_D(QmlEngineDebug);
QmlDebugObjectQuery *query = new QmlDebugObjectQuery(parent);
- if (d->client.isConnected() && object.debugId() != -1) {
+ if (d->client->isConnected() && object.debugId() != -1) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
@@ -301,7 +301,7 @@ QmlDebugObjectQuery *QmlEngineDebug::queryObject(const QmlDebugObjectReference &
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
<< false;
- d->client.sendMessage(message);
+ d->client->sendMessage(message);
} else {
query->m_state = QmlDebugQuery::Error;
}
@@ -314,7 +314,7 @@ QmlDebugObjectQuery *QmlEngineDebug::queryObjectRecursive(const QmlDebugObjectRe
Q_D(QmlEngineDebug);
QmlDebugObjectQuery *query = new QmlDebugObjectQuery(parent);
- if (d->client.isConnected() && object.debugId() != -1) {
+ if (d->client->isConnected() && object.debugId() != -1) {
query->m_client = this;
int queryId = d->getId();
query->m_queryId = queryId;
@@ -324,7 +324,7 @@ QmlDebugObjectQuery *QmlEngineDebug::queryObjectRecursive(const QmlDebugObjectRe
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
<< true;
- d->client.sendMessage(message);
+ d->client->sendMessage(message);
} else {
query->m_state = QmlDebugQuery::Error;
}