You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/01 11:10:30 UTC

[34/35] git commit: Fix monitoring when no parent is provided.

Fix monitoring when no parent is provided.

Will squash this down after review.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/commit/ddc0db2c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/tree/ddc0db2c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/diff/ddc0db2c

Branch: refs/heads/windsor-merge
Commit: ddc0db2c520eb0d82afaaa777130da0463cd6229
Parents: fbe7ae6
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Aug 8 13:33:50 2013 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 30 17:50:01 2014 +0100

----------------------------------------------------------------------
 src/couch_event_listener_mfa.erl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-event/blob/ddc0db2c/src/couch_event_listener_mfa.erl
----------------------------------------------------------------------
diff --git a/src/couch_event_listener_mfa.erl b/src/couch_event_listener_mfa.erl
index acc646c..9be5888 100644
--- a/src/couch_event_listener_mfa.erl
+++ b/src/couch_event_listener_mfa.erl
@@ -48,10 +48,12 @@ start_link(Mod, Func, State, Options) ->
 
 enter_loop(Mod, Func, State, Options) ->
     Parent = case proplists:get_value(parent, Options) of
-        P when is_pid(P) -> P;
-        _ -> undefined
+        P when is_pid(P) ->
+            erlang:monitor(process, P),
+            P;
+        _ ->
+            undefined
     end,
-    erlang:monitor(process, Parent),
     St = #st{
         mod = Mod,
         func = Func,