Skip to content

Commit

Permalink
Wallet: fix listener leak
Browse files Browse the repository at this point in the history
  • Loading branch information
mps01k committed Apr 9, 2018
1 parent 6a7e388 commit eb5a261
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libwalletqt/Wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ Wallet::Wallet(Superior::Wallet *w, QObject *parent)
m_history = new TransactionHistory(m_walletImpl->history(), this);
m_addressBook = new AddressBook(m_walletImpl->addressBook(), this);
m_subaddress = new Subaddress(m_walletImpl->subaddress(), this);
m_walletListener = new WalletListenerImpl(this);
m_walletImpl->setListener(new WalletListenerImpl(this));
m_connectionStatus = Wallet::ConnectionStatus_Disconnected;
// start cache timers
Expand Down Expand Up @@ -896,5 +897,7 @@ Wallet::~Wallet()
qDebug("Error storing wallet cache");
delete m_walletImpl;
m_walletImpl = NULL;
delete m_walletListener;
m_walletListener = NULL;
qDebug("m_walletImpl deleted");
}
1 change: 1 addition & 0 deletions src/libwalletqt/Wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ class Wallet : public QObject
bool m_connectionStatusRunning;
QString m_daemonUsername;
QString m_daemonPassword;
Superior::WalletListener *m_walletListener;
};


Expand Down

0 comments on commit eb5a261

Please sign in to comment.