qt: Plug many memory leaks

None of these are very serious, and are leaks in objects that are
created at most one time.

In most cases this means properly using the QObject parent hierarchy,
except for BanTablePriv/PeerTablePriv which are not QObject,
so use a std::unique_ptr instead.

Github-Pull: #9190
Rebased-From: 47db07537746940ee7dd0739a8c73e328837813f
This commit is contained in:
Wladimir J. van der Laan
2016-11-18 15:47:20 +01:00
committed by Luke Dashjr
parent ff423cc6b0
commit dc46b10a08
16 changed files with 40 additions and 26 deletions

View File

@@ -86,7 +86,7 @@ BanTableModel::BanTableModel(ClientModel *parent) :
clientModel(parent)
{
columns << tr("IP/Netmask") << tr("Banned Until");
priv = new BanTablePriv();
priv.reset(new BanTablePriv());
// default to unsorted
priv->sortColumn = -1;
@@ -94,6 +94,11 @@ BanTableModel::BanTableModel(ClientModel *parent) :
refresh();
}
BanTableModel::~BanTableModel()
{
// Intentionally left empty
}
int BanTableModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);