Skip to content

Commit

Permalink
Bug 2186: Close socket when ns_memcached terminates.
Browse files Browse the repository at this point in the history
Otherwise, if it crashes, we leak connections.

Change-Id: I94f1a6b1651184dea77aad5f72b850cccefb62d2
Reviewed-on: http://review.northscale.com/2088
Reviewed-by: Dustin Sallings <dustin@spy.net>
Tested-by: Dustin Sallings <dustin@spy.net>
  • Loading branch information
Sean Lynch authored and dustin committed Aug 23, 2010
1 parent f395567 commit 67e0099
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ns_memcached.erl
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ handle_info(Msg, State) ->
{noreply, State}.


terminate(_Reason, _State) ->
terminate(_Reason, State) ->
catch gen_tcp:close(State#state.sock),
ok.


Expand Down

0 comments on commit 67e0099

Please sign in to comment.