Fix memory leak when outbound socket is closed by server

ESL-88 --resolve

Signed-off-by: Travis Cross <tc@traviscross.com>
This commit is contained in:
Ico 2014-03-25 12:31:23 +02:00 committed by Travis Cross
parent 04de0f77d3
commit fa17059787
1 changed files with 2 additions and 3 deletions

View File

@ -50,10 +50,9 @@ ESLconnection::ESLconnection(int socket)
ESLconnection::~ESLconnection()
{
if (handle.connected) {
if (!handle.destroyed) {
esl_disconnect(&handle);
}
}
int ESLconnection::socketDescriptor()
@ -68,7 +67,7 @@ int ESLconnection::socketDescriptor()
int ESLconnection::disconnect()
{
if (handle.connected) {
if (!handle.destroyed) {
return esl_disconnect(&handle);
}