mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-21 20:28:59 +02:00
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.
This commit is contained in:
@@ -114,12 +114,12 @@ PeerTableModel::PeerTableModel(ClientModel *parent) :
|
||||
timer(0)
|
||||
{
|
||||
columns << tr("NodeId") << tr("Node/Service") << tr("User Agent") << tr("Ping");
|
||||
priv = new PeerTablePriv();
|
||||
priv.reset(new PeerTablePriv());
|
||||
// default to unsorted
|
||||
priv->sortColumn = -1;
|
||||
|
||||
// set up timer for auto refresh
|
||||
timer = new QTimer();
|
||||
timer = new QTimer(this);
|
||||
connect(timer, SIGNAL(timeout()), SLOT(refresh()));
|
||||
timer->setInterval(MODEL_UPDATE_DELAY);
|
||||
|
||||
@@ -127,6 +127,11 @@ PeerTableModel::PeerTableModel(ClientModel *parent) :
|
||||
refresh();
|
||||
}
|
||||
|
||||
PeerTableModel::~PeerTableModel()
|
||||
{
|
||||
// Intentionally left empty
|
||||
}
|
||||
|
||||
void PeerTableModel::startAutoRefresh()
|
||||
{
|
||||
timer->start();
|
||||
|
||||
Reference in New Issue
Block a user