From 00316e182bb2c3cdf0ce6126b658eb45e1864e60 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Thu, 25 Apr 2013 01:59:20 +1200 Subject: [PATCH] Cleanup session data on deconstruct. --- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp index 3f1242b5f4..01ee3ea78b 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp @@ -40,6 +40,18 @@ CWII_IPC_HLE_Device_net_ssl::CWII_IPC_HLE_Device_net_ssl(u32 _DeviceID, const st CWII_IPC_HLE_Device_net_ssl::~CWII_IPC_HLE_Device_net_ssl() { + // Cleanup sessions + for (int i = 0; i < NET_SSL_MAXINSTANCES; i++) + { + gnutls_session_t session = _SSL[i].session; + if(session) + { + gnutls_bye (session, GNUTLS_SHUT_RDWR); + gnutls_deinit(session); + gnutls_certificate_free_credentials (_SSL[i].xcred); + } + } + gnutls_global_deinit(); }