Skip to content

Commit

Permalink
Merge pull request #1188 from majestrate/call-jsonrpc-server-cleanup-…
Browse files Browse the repository at this point in the history
…2020-03-16

fix memleak in jsonrpc
  • Loading branch information
majestrate authored Mar 16, 2020
2 parents 03da1d7 + 1e434c0 commit b1f036b
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit b1f036b

Please sign in to comment.