mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
gui: Fix itemWalletAddress leak when not tree mode
This commit is contained in:
parent
afa577c323
commit
e8123eae40
2 changed files with 2 additions and 4 deletions
|
@ -606,8 +606,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())
|
||||
|
@ -616,7 +615,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…
Add table
Reference in a new issue