mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-01 17:26:12 +00:00
gui: Fix itemWalletAddress leak when not tree mode
Github-Pull: #18578 Rebased-From: e8123eae40eb264bbb71007d0eb074901f0e2fe5
This commit is contained in:
parent
aa7c6858e6
commit
315ae14f3f
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user