diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-01-22 23:45:34 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-01 21:34:52 +0100 |
commit | c794d61b161ad48312bf079f1e5f483cfac1dc38 (patch) | |
tree | 8a381d5310c4a16c7d746bbdca77c9d24a441061 | |
parent | d9286b1ad5516082bc9b40adaceb9485acf4a553 (diff) | |
download | libquotient-c794d61b161ad48312bf079f1e5f483cfac1dc38.tar.gz libquotient-c794d61b161ad48312bf079f1e5f483cfac1dc38.zip |
Add destructor
-rw-r--r-- | lib/olm/qolmaccount.cpp | 5 | ||||
-rw-r--r-- | lib/olm/qolmaccount.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/olm/qolmaccount.cpp b/lib/olm/qolmaccount.cpp index 673f613b..a6a07962 100644 --- a/lib/olm/qolmaccount.cpp +++ b/lib/olm/qolmaccount.cpp @@ -66,6 +66,11 @@ QOlmAccount::QOlmAccount(OlmAccount *account) : m_account(account) {} +QOlmAccount::~QOlmAccount() +{ + olm_clear_account(m_account); +} + std::optional<QOlmAccount> QOlmAccount::create() { auto account = olm_account(new uint8_t[olm_account_size()]); diff --git a/lib/olm/qolmaccount.h b/lib/olm/qolmaccount.h index 219d7e48..268cd5d5 100644 --- a/lib/olm/qolmaccount.h +++ b/lib/olm/qolmaccount.h @@ -49,6 +49,8 @@ bool operator==(const IdentityKeys& lhs, const IdentityKeys& rhs); class QOlmAccount { public: + ~QOlmAccount(); + enum OlmAccountError { BadAccountKey, BadMessageKeyId, |