mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 08:44:02 +02:00
gui: Fix itemWalletAddress leak when not tree mode
Github-Pull: #18578
Rebased-From: e8123eae40
This commit is contained in:
@@ -612,8 +612,7 @@ void CoinControlDialog::updateView()
|
||||
int nDisplayUnit = model->getOptionsModel()->getDisplayUnit();
|
||||
|
||||
for (const auto& coins : model->wallet().listCoins()) {
|
||||
CCoinControlWidgetItem *itemWalletAddress = new CCoinControlWidgetItem();
|
||||
itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
|
||||
CCoinControlWidgetItem* itemWalletAddress{nullptr};
|
||||
QString sWalletAddress = QString::fromStdString(EncodeDestination(coins.first));
|
||||
QString sWalletLabel = model->getAddressTableModel()->labelForAddress(sWalletAddress);
|
||||
if (sWalletLabel.isEmpty())
|
||||
@@ -622,7 +621,7 @@ void CoinControlDialog::updateView()
|
||||
if (treeMode)
|
||||
{
|
||||
// wallet address
|
||||
ui->treeWidget->addTopLevelItem(itemWalletAddress);
|
||||
itemWalletAddress = new CCoinControlWidgetItem(ui->treeWidget);
|
||||
|
||||
itemWalletAddress->setFlags(flgTristate);
|
||||
itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
|
||||
|
||||
@@ -31,7 +31,6 @@ class CCoinControlWidgetItem : public QTreeWidgetItem
|
||||
{
|
||||
public:
|
||||
explicit CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
|
||||
explicit CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
|
||||
explicit CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
|
||||
|
||||
bool operator<(const QTreeWidgetItem &other) const;
|
||||
|
||||
Reference in New Issue
Block a user