diff options
Diffstat (limited to 'src/scripttools/debugging')
-rw-r--r-- | src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp index e096ba8..3226262 100644 --- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp +++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp @@ -136,6 +136,7 @@ public: const QScriptDebuggerValuePropertyList &props); void deleteObjectSnapshots(const QList<qint64> &snapshotIds); + void deleteAllObjectSnapshots(); QScriptDebuggerJobSchedulerInterface *jobScheduler; QScriptDebuggerCommandSchedulerInterface *commandScheduler; @@ -151,6 +152,7 @@ QScriptDebuggerLocalsModelPrivate::QScriptDebuggerLocalsModelPrivate() QScriptDebuggerLocalsModelPrivate::~QScriptDebuggerLocalsModelPrivate() { + deleteAllObjectSnapshots(); delete invisibleRootNode; } @@ -240,6 +242,14 @@ void QScriptDebuggerLocalsModelPrivate::deleteObjectSnapshots(const QList<qint64 frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(i)); } +void QScriptDebuggerLocalsModelPrivate::deleteAllObjectSnapshots() +{ + QList<qint64> snapshotIds; + for (int i = 0; i < invisibleRootNode->children.count(); ++i) + snapshotIds += findSnapshotIdsRecursively(invisibleRootNode->children.at(i)); + deleteObjectSnapshots(snapshotIds); +} + QScriptDebuggerLocalsModelPrivate *QScriptDebuggerLocalsModelPrivate::get(QScriptDebuggerLocalsModel *q) { return q->d_func(); @@ -442,13 +452,6 @@ QScriptDebuggerLocalsModel::QScriptDebuggerLocalsModel( QScriptDebuggerLocalsModel::~QScriptDebuggerLocalsModel() { - Q_D(QScriptDebuggerLocalsModel); - QList<qint64> snapshotIds; - for (int i = 0; i < d->invisibleRootNode->children.count(); ++i) - snapshotIds += findSnapshotIdsRecursively(d->invisibleRootNode->children.at(i)); - QScriptDebuggerCommandSchedulerFrontend frontend(d->commandScheduler, 0); - for (int j = 0; j < snapshotIds.size(); ++j) - frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(j)); } QModelIndex QScriptDebuggerLocalsModelPrivate::addTopLevelObject(const QString &name, const QScriptDebuggerValue &object) |