aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_reg.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/diameter/src/base/diameter_reg.erl')
-rw-r--r--lib/diameter/src/base/diameter_reg.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_reg.erl b/lib/diameter/src/base/diameter_reg.erl
index bd5db54a5c..e0c41a2834 100644
--- a/lib/diameter/src/base/diameter_reg.erl
+++ b/lib/diameter/src/base/diameter_reg.erl
@@ -238,7 +238,11 @@ handle_call({add, Uniq, Key}, {Pid, _}, S) ->
Rec = {Key, Pid},
NS = flush(Uniq, Rec, S), %% before insert
{Res, New} = insert(Uniq, Rec),
- {reply, Res, notify(add, New andalso Rec, NS)};
+ {reply, Res, notify(add, New andalso Rec, if New ->
+ add_monitor(Pid, NS);
+ true ->
+ NS
+ end)};
handle_call({remove, Key}, {Pid, _}, S) ->
Rec = {Key, Pid},