diff options
author | kali <kali@leap.se> | 2021-02-03 22:46:45 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-02-08 23:32:18 +0100 |
commit | a7dcea9a6e6e5b4b2eccc2ed0d6803c8408ffd0e (patch) | |
tree | 0ed16478bcad33f86a4e4266a92b4b1f4ce8c09d /gui/qjsonmodel.h | |
parent | f5e7a5d2cab5fc3cfca8c5f75e57090cda27c4e1 (diff) |
[bug] add mutex to critical region
This fixes the segfault.
mRootItem has to be deallocated to avoid memory leaks, but doing it
concurrently with the dump of the json was a terrible idea.
- Closes: #360
Diffstat (limited to 'gui/qjsonmodel.h')
-rw-r--r-- | gui/qjsonmodel.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gui/qjsonmodel.h b/gui/qjsonmodel.h index c7d25bb..50eebcd 100644 --- a/gui/qjsonmodel.h +++ b/gui/qjsonmodel.h @@ -83,7 +83,7 @@ public: QJsonModel(const QString& fileName, QObject *parent = nullptr); QJsonModel(QIODevice * device, QObject *parent = nullptr); QJsonModel(const QByteArray& json, QObject *parent = nullptr); - ~QJsonModel(); + virtual ~QJsonModel(); bool load(const QString& fileName); bool load(QIODevice * device); bool loadJson(const QByteArray& json); @@ -101,11 +101,8 @@ public: private: QJsonValue genJson(QJsonTreeItem *) const; - QJsonTreeItem * mRootItem; QStringList mHeaders; - - }; #endif // QJSONMODEL_H |