TransactionHistory: fix use-after-free bugs

This commit is contained in:
xiphon
2019-12-16 07:50:01 +00:00
parent 46227bdad0
commit 4e1f7349c4
5 changed files with 118 additions and 145 deletions

View File

@@ -50,9 +50,8 @@ class TransactionHistory : public QObject
Q_PROPERTY(bool locked READ locked)
public:
Q_INVOKABLE TransactionInfo *transaction(int index);
Q_INVOKABLE bool transaction(int index, std::function<void (TransactionInfo &)> callback);
// Q_INVOKABLE TransactionInfo * transaction(const QString &id);
Q_INVOKABLE QList<TransactionInfo*> getAll(quint32 accountIndex) const;
Q_INVOKABLE void refresh(quint32 accountIndex);
Q_INVOKABLE QString writeCSV(quint32 accountIndex, QString out);
quint64 count() const;
@@ -75,9 +74,9 @@ private:
private:
friend class Wallet;
mutable QReadWriteLock m_lock;
Monero::TransactionHistory * m_pimpl;
mutable QList<TransactionInfo*> m_tinfo;
mutable QReadWriteLock m_tinfoLock;
mutable QDateTime m_firstDateTime;
mutable QDateTime m_lastDateTime;
mutable int m_minutesToUnlock;