Qt: Plug credentials model memory leak

This commit is contained in:
John Thacker 2022-11-30 08:39:03 -05:00
parent 058400d8e0
commit 9afd2f23ef
2 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,11 @@ CredentialsModel::CredentialsModel(QObject *parent)
{
}
CredentialsModel::~CredentialsModel()
{
clear();
}
int CredentialsModel::rowCount(const QModelIndex &) const
{
return static_cast<int>(credentials_.count());

View File

@ -25,6 +25,7 @@ class CredentialsModel : public QAbstractListModel
public:
CredentialsModel(QObject *parent);
~CredentialsModel();
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const ;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;