Permalink
Browse files

Anders Dahlin found that yaws log code doesn't delete the gen_event h…

…andler it adds error logger when terminating, that means that restarting yaws leaves old processes hanging around
  • Loading branch information...
1 parent b45c0a4 commit 6f0ab17f1fbd8dc27da782faba571f08790351c9 @klacke committed Feb 19, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/yaws_log.erl
View
6 src/yaws_log.erl
@@ -98,6 +98,7 @@ actl_trace(What) ->
%% {stop, Reason}
%%----------------------------------------------------------------------
init([]) ->
+ process_flag(trap_exit, true),
{ok, #state{running = false, now = fmtnow()}}.
%%----------------------------------------------------------------------
@@ -403,7 +404,9 @@ handle_info(minute10, State) ->
ok
end,
{noreply, State#state{alogs= L,
- auth_log = wrap(State#state.auth_log, State)}}.
+ auth_log = wrap(State#state.auth_log, State)}};
+handle_info({'EXIT', _, _}, State) ->
+ {noreply, State}.
@@ -455,6 +458,7 @@ wrap(AL, State) ->
%% Returns: any (ignored by gen_server)
%%----------------------------------------------------------------------
terminate(_Reason, _State) ->
+ gen_event:delete_handler(error_logger, yaws_log_file_h, normal),
ok.
%%%----------------------------------------------------------------------

0 comments on commit 6f0ab17

Please sign in to comment.