Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memleak in jsonrpc #1188

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions llarp/ev/ev_libuv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ namespace libuv
m_Accept->close = &ExplicitCloseAccept;
m_Conn.write = nullptr;
m_Conn.closed = nullptr;
m_Conn.tick = nullptr;
}

conn_glue(conn_glue* parent) : m_TCP(nullptr), m_Accept(nullptr)
Expand Down Expand Up @@ -304,9 +305,13 @@ namespace libuv
Tick()
{
if(m_Accept && m_Accept->tick)
{
m_Accept->tick(m_Accept);
}
if(m_Conn.tick)
{
m_Conn.tick(&m_Conn);
}
}

void
Expand Down Expand Up @@ -346,6 +351,7 @@ namespace libuv
bool
Server()
{
uv_check_start(&m_Ticker, &OnTick);
m_Accept->close = &ExplicitCloseAccept;
return uv_tcp_bind(&m_Handle, m_Addr, 0) == 0
&& uv_listen(Stream(), 5, &OnAccept) == 0;
Expand Down