diff --git a/src/enoise_connection.erl b/src/enoise_connection.erl index e98a7ec..677882b 100644 --- a/src/enoise_connection.erl +++ b/src/enoise_connection.erl @@ -45,6 +45,7 @@ start_link(TcpSock, Rx, Tx, Owner, {Active0, Buf}) -> flush_tcp(Pid, TcpSock), {ok, Pid}; Err = {error, _} -> + close(Pid), Err end; Err = {error, _} ->