Showing the changes to interface/src/ScriptsModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -67,6 +67,13 @@ ScriptsModel::ScriptsModel(QObject* parent) : · 66 unmodified lines | ||
| 67 | 67 | reloadRemoteFiles(); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | +ScriptsModel::~ScriptsModel() { | |
| 71 | + for (int i = _treeNodes.size() - 1; i >= 0; i--) { | |
| 72 | + delete _treeNodes.at(i); | |
| 73 | + } | |
| 74 | + _treeNodes.clear(); | |
| 75 | +} | |
| 76 | + | |
| 70 | 77 | TreeNodeBase* ScriptsModel::getTreeNodeFromIndex(const QModelIndex& index) const { |
| 71 | 78 | if (index.isValid()) { |
| 72 | 79 | return static_cast<TreeNodeBase*>(index.internalPointer()); |