提交 f6c75246 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Fix #529

上级 6f2d110a
......@@ -493,13 +493,12 @@ inline void TcpConnection::OnUvWrite(int status, TcpConnection::onSendCallback*
{
MS_TRACE();
// NOTE: Do not delete cb here since it will be delete in onWrite() above.
if (status == 0)
{
if (cb)
{
(*cb)(true);
delete cb;
}
}
else
{
......@@ -509,10 +508,7 @@ inline void TcpConnection::OnUvWrite(int status, TcpConnection::onSendCallback*
MS_WARN_DEV("write error, closing the connection: %s", uv_strerror(status));
if (cb)
{
(*cb)(false);
delete cb;
}
Close();
......
......@@ -288,13 +288,12 @@ inline void UdpSocket::OnUvSend(int status, UdpSocket::onSendCallback* cb)
{
MS_TRACE();
// NOTE: Do not delete cb here since it will be delete in onSend() above.
if (status == 0)
{
if (cb)
{
(*cb)(true);
delete cb;
}
}
else
{
......@@ -303,9 +302,6 @@ inline void UdpSocket::OnUvSend(int status, UdpSocket::onSendCallback* cb)
#endif
if (cb)
{
(*cb)(false);
delete cb;
}
}
}
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论