mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 12:09:57 +00:00
Merge pull request #2179
1cffa8b
WalletManager: fix crash on null/dangling pointer dereference (xiphon)
This commit is contained in:
commit
f8a6dec0ed
2 changed files with 10 additions and 3 deletions
|
@ -378,8 +378,14 @@ double WalletManager::miningHashRate() const
|
|||
|
||||
bool WalletManager::isMining() const
|
||||
{
|
||||
if(!m_currentWallet->connected())
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
if (m_currentWallet == nullptr || !m_currentWallet->connected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return m_pimpl->isMining();
|
||||
}
|
||||
|
||||
|
@ -414,6 +420,7 @@ QString WalletManager::resolveOpenAlias(const QString &address) const
|
|||
}
|
||||
bool WalletManager::parse_uri(const QString &uri, QString &address, QString &payment_id, uint64_t &amount, QString &tx_description, QString &recipient_name, QVector<QString> &unknown_parameters, QString &error) const
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
if (m_currentWallet)
|
||||
return m_currentWallet->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error);
|
||||
return false;
|
||||
|
|
|
@ -209,7 +209,7 @@ private:
|
|||
explicit WalletManager(QObject *parent = 0);
|
||||
static WalletManager * m_instance;
|
||||
Monero::WalletManager * m_pimpl;
|
||||
QMutex m_mutex;
|
||||
mutable QMutex m_mutex;
|
||||
QPointer<Wallet> m_currentWallet;
|
||||
|
||||
QWaitCondition m_cond_pass;
|
||||
|
|
Loading…
Reference in a new issue