Cleanup session data on deconstruct.

This commit is contained in:
Matthew Parlane 2013-04-25 01:59:20 +12:00
parent c3dbbe011d
commit 00316e182b
1 changed files with 12 additions and 0 deletions

View File

@ -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();
}