Skip to content

Commit

Permalink
fix barrel_server
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Aug 17, 2013
1 parent af73f72 commit 2f67a10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/barrel_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ start_link() ->

init([]) ->
Monitors = [{{erlang:monitor(process, Pid), Pid}, Ref} ||
[Ref, Pid] <- ets:match(?TAB, {{conns_sup, '$1'}, '$2'})],
[Ref, Pid] <- ets:match(?TAB, {{listeners, '$1'}, '$2'})],
{ok, #state{monitors=Monitors}}.


Expand All @@ -58,7 +58,7 @@ handle_cast(_Request, State) ->
handle_info({'DOWN', MRef, process, Pid, _},
State=#state{monitors=Monitors}) ->
{_, Ref} = lists:keyfind({MRef, Pid}, 1, Monitors),
true = ets:delete(?TAB, {conns_sup, Ref}),
true = ets:delete(?TAB, {listeners, Ref}),
Monitors2 = lists:keydelete({MRef, Pid}, 1, Monitors),
{noreply, State#state{monitors=Monitors2}};
handle_info(_Info, State) ->
Expand Down

0 comments on commit 2f67a10

Please sign in to comment.