Fix memory leak in QJsonModel.
This commit is contained in:
parent
ab37c301d5
commit
b348a45834
@ -36,6 +36,13 @@ QJsonModel::QJsonModel(QObject *parent) :
|
||||
|
||||
}
|
||||
|
||||
|
||||
QJsonModel::~QJsonModel()
|
||||
{
|
||||
delete mRootItem;
|
||||
}
|
||||
|
||||
|
||||
bool QJsonModel::load(const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user