aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-01-22 23:45:34 +0100
committerTobias Fella <fella@posteo.de>2021-12-01 21:34:52 +0100
commitc794d61b161ad48312bf079f1e5f483cfac1dc38 (patch)
tree8a381d5310c4a16c7d746bbdca77c9d24a441061
parentd9286b1ad5516082bc9b40adaceb9485acf4a553 (diff)
downloadlibquotient-c794d61b161ad48312bf079f1e5f483cfac1dc38.tar.gz
libquotient-c794d61b161ad48312bf079f1e5f483cfac1dc38.zip
Add destructor
-rw-r--r--lib/olm/qolmaccount.cpp5
-rw-r--r--lib/olm/qolmaccount.h2
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,