提交 fa170597 authored 作者: Ico's avatar Ico 提交者: Travis Cross

Fix memory leak when outbound socket is closed by server

ESL-88 --resolve
Signed-off-by: 's avatarTravis Cross <tc@traviscross.com>
上级 04de0f77
...@@ -50,10 +50,9 @@ ESLconnection::ESLconnection(int socket) ...@@ -50,10 +50,9 @@ ESLconnection::ESLconnection(int socket)
ESLconnection::~ESLconnection() ESLconnection::~ESLconnection()
{ {
if (handle.connected) { if (!handle.destroyed) {
esl_disconnect(&handle); esl_disconnect(&handle);
} }
} }
int ESLconnection::socketDescriptor() int ESLconnection::socketDescriptor()
...@@ -68,7 +67,7 @@ int ESLconnection::socketDescriptor() ...@@ -68,7 +67,7 @@ int ESLconnection::socketDescriptor()
int ESLconnection::disconnect() int ESLconnection::disconnect()
{ {
if (handle.connected) { if (!handle.destroyed) {
return esl_disconnect(&handle); return esl_disconnect(&handle);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论