mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 03:42:05 +02:00
Merge pull request #2179
1cffa8b
WalletManager: fix crash on null/dangling pointer dereference (xiphon)
This commit is contained in:
commit
f8a6dec0ed
@ -378,8 +378,14 @@ double WalletManager::miningHashRate() const
|
|||||||
|
|
||||||
bool WalletManager::isMining() const
|
bool WalletManager::isMining() const
|
||||||
{
|
{
|
||||||
if(!m_currentWallet->connected())
|
{
|
||||||
|
QMutexLocker locker(&m_mutex);
|
||||||
|
if (m_currentWallet == nullptr || !m_currentWallet->connected())
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return m_pimpl->isMining();
|
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
|
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)
|
if (m_currentWallet)
|
||||||
return m_currentWallet->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error);
|
return m_currentWallet->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error);
|
||||||
return false;
|
return false;
|
||||||
|
@ -209,7 +209,7 @@ private:
|
|||||||
explicit WalletManager(QObject *parent = 0);
|
explicit WalletManager(QObject *parent = 0);
|
||||||
static WalletManager * m_instance;
|
static WalletManager * m_instance;
|
||||||
Monero::WalletManager * m_pimpl;
|
Monero::WalletManager * m_pimpl;
|
||||||
QMutex m_mutex;
|
mutable QMutex m_mutex;
|
||||||
QPointer<Wallet> m_currentWallet;
|
QPointer<Wallet> m_currentWallet;
|
||||||
|
|
||||||
QWaitCondition m_cond_pass;
|
QWaitCondition m_cond_pass;
|
||||||
|
Loading…
Reference in New Issue
Block a user