diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-11-10 02:41:21 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-11-10 02:41:21 (GMT) |
commit | ae9b78bff688decf9de4ead0343d8e50d40150ba (patch) | |
tree | 2cabbf3cea396c33c2d2e444c8b26f2f7a643082 /src/declarative/debugger | |
parent | 3b37a6463c7598adb009bd3fe2e20587a19425ae (diff) | |
download | Qt-ae9b78bff688decf9de4ead0343d8e50d40150ba.zip Qt-ae9b78bff688decf9de4ead0343d8e50d40150ba.tar.gz Qt-ae9b78bff688decf9de4ead0343d8e50d40150ba.tar.bz2 |
Minor improvements, additional pointer checks.
Diffstat (limited to 'src/declarative/debugger')
-rw-r--r-- | src/declarative/debugger/qmldebug.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index 1403ffa..f24b456 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -107,31 +107,35 @@ int QmlEngineDebugPrivate::getId() void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugEnginesQuery *q) { - QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - if (p && q) + if (c && q) { + QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); p->enginesQuery.remove(q->m_queryId); + } } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugRootContextQuery *q) { - QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - if (p && q) + if (c && q) { + QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); p->rootContextQuery.remove(q->m_queryId); + } } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugObjectQuery *q) { - QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - if (p && q) + if (c && q) { + QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); p->objectQuery.remove(q->m_queryId); + } } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugExpressionQuery *q) { - QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - if (p && q) + if (c && q) { + QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); p->expressionQuery.remove(q->m_queryId); + } } @@ -424,6 +428,9 @@ void QmlEngineDebug::removeWatch(QmlDebugWatch *watch) { Q_D(QmlEngineDebug); + if (!watch || watch->state() == QmlDebugWatch::Inactive || watch->state() == QmlDebugWatch::Dead) + return; + watch->setState(QmlDebugWatch::Inactive); d->watched.remove(watch->queryId()); @@ -555,7 +562,8 @@ QmlDebugWatch::QmlDebugWatch(QObject *parent) QmlDebugWatch::~QmlDebugWatch() { - m_client->removeWatch(this); + if (m_client) + m_client->removeWatch(this); } int QmlDebugWatch::queryId() const |