summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_ref_counter.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_ref_counter.erl')
-rw-r--r--src/couchdb/couch_ref_counter.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/couchdb/couch_ref_counter.erl b/src/couchdb/couch_ref_counter.erl
index 96d92333..5c8e7437 100644
--- a/src/couchdb/couch_ref_counter.erl
+++ b/src/couchdb/couch_ref_counter.erl
@@ -40,18 +40,17 @@ count(RefCounterPid) ->
-record(srv,
{
- referrers=dict:new(), % a dict of each ref counting proc.
- child_procs=[]
+ referrers=dict:new() % a dict of each ref counting proc.
}).
init({Pid, ChildProcs}) ->
[link(ChildProc) || ChildProc <- ChildProcs],
Referrers = dict:from_list([{Pid, {erlang:monitor(process, Pid), 1}}]),
- {ok, #srv{referrers=Referrers, child_procs=ChildProcs}}.
+ {ok, #srv{referrers=Referrers}}.
-terminate(_Reason, #srv{child_procs=ChildProcs}) ->
- [couch_util:shutdown_sync(Pid) || Pid <- ChildProcs],
+terminate(Reason, _Srv) ->
+ couch_util:terminate_linked(Reason),
ok.