From c794d61b161ad48312bf079f1e5f483cfac1dc38 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 22 Jan 2021 23:45:34 +0100 Subject: Add destructor --- lib/olm/qolmaccount.cpp | 5 +++++ lib/olm/qolmaccount.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'lib') 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::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, -- cgit v1.2.3