Fix memory leak in QJsonModel.

This commit is contained in:
Teo Mrnjavac 2015-06-13 20:31:41 +02:00
parent ab37c301d5
commit b348a45834
2 changed files with 8 additions and 0 deletions

View File

@ -36,6 +36,13 @@ QJsonModel::QJsonModel(QObject *parent) :
}
QJsonModel::~QJsonModel()
{
delete mRootItem;
}
bool QJsonModel::load(const QString &fileName)
{
QFile file(fileName);

View File

@ -31,6 +31,7 @@ class QJsonModel : public QAbstractItemModel
Q_OBJECT
public:
explicit QJsonModel(QObject *parent = 0);
virtual ~QJsonModel();
bool load(const QString& fileName);
bool load(QIODevice * device);
bool loadJson(const QByteArray& json);