diff options
author | Simjees Abraham <simjees.abraham@nokia.com> | 2012-05-25 09:02:44 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-30 12:07:19 +0200 |
commit | f50afbad6c6f8f4241db3c1d40c74c3aaa1fda83 (patch) | |
tree | 889eec0b0a5522756997a014cdcc34f62bf701d1 /src | |
parent | f653c2b1bb8ac7bae7ff4412485a8910db5c94bd (diff) |
Debugger: Clearing the ObjectReferenceHash
ObjectReferenceHash is cleared when the Qml file is reloaded.
Change-Id: I78da1d88cce2f04fe820f3af14b047cd562e90ed
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp | 3 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugservice.cpp | 7 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugservice_p.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp index dbe511957c..a42663eda0 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp @@ -45,6 +45,7 @@ #include "inspecttool.h" #include <QtQml/private/qqmlengine_p.h> +#include <QtQml/private/qqmldebugservice_p.h> #include <QtQuick/private/qquickitem_p.h> #include <QtQuick/QQuickView> @@ -321,6 +322,8 @@ void QQuickViewInspector::reloadQmlFile(const QHash<QString, QByteArray> &change // Reset the selection since we are reloading the main qml setSelectedItems(QList<QQuickItem *>()); + QQmlDebugService::clearObjectsFromHash(); + QHash<QUrl, QByteArray> debugCache; foreach (const QString &str, changesHash.keys()) diff --git a/src/qml/debugger/qqmldebugservice.cpp b/src/qml/debugger/qqmldebugservice.cpp index 511c8549a3..d3d4df70cd 100644 --- a/src/qml/debugger/qqmldebugservice.cpp +++ b/src/qml/debugger/qqmldebugservice.cpp @@ -257,6 +257,13 @@ void QQmlDebugService::removeInvalidObjectsFromHash() } } +void QQmlDebugService::clearObjectsFromHash() +{ + ObjectReferenceHash *hash = objectReferenceHash(); + hash->ids.clear(); + hash->objects.clear(); +} + bool QQmlDebugService::isDebuggingEnabled() { return QQmlDebugServer::instance() != 0; diff --git a/src/qml/debugger/qqmldebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h index 4a0b52e429..4fc37e6b7f 100644 --- a/src/qml/debugger/qqmldebugservice_p.h +++ b/src/qml/debugger/qqmldebugservice_p.h @@ -88,6 +88,7 @@ public: static QList<QObject*> objectForLocationInfo(const QString &filename, int lineNumber, int columnNumber); static void removeInvalidObjectsFromHash(); + static void clearObjectsFromHash(); static QString objectToString(QObject *obj); |