From fe626138e891a1a164f96997456a667a43e75f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 20 Aug 2015 12:00:58 +0200 Subject: [PATCH] Add proper destructor for HelloHTTPS Just as a matter of principle --- yotta/data/example-tls-client/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/yotta/data/example-tls-client/main.cpp b/yotta/data/example-tls-client/main.cpp index 0014065a6..c90707b5c 100644 --- a/yotta/data/example-tls-client/main.cpp +++ b/yotta/data/example-tls-client/main.cpp @@ -121,10 +121,6 @@ public: * HelloHTTPS Constructor * Initializes the TCP socket, sets up event handlers and flags. * - * Note that CThunk is used for event handlers. This will be changed to a C++ - * function pointer in an upcoming release. - * - * * @param[in] domain The domain name to fetch from * @param[in] port The port of the HTTPS server */ @@ -145,6 +141,16 @@ public: mbedtls_ssl_init(&_ssl); mbedtls_ssl_config_init(&_ssl_conf); } + /** + * HelloHTTPS Desctructor + */ + ~HelloHTTPS() { + mbedtls_entropy_free(&_entropy); + mbedtls_ctr_drbg_free(&_ctr_drbg); + mbedtls_x509_crt_free(&_cacert); + mbedtls_ssl_free(&_ssl); + mbedtls_ssl_config_free(&_ssl_conf); + } /** * Initiate the test. *