Permalink
Browse files

Reset the loop count on unsubscribe

  • Loading branch information...
1 parent 33f1771 commit 60d5384e65b30e3e0bb2cfc7b1df46158acffaa6 @nisbus committed Nov 1, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/monterl_carlo.erl
View
3 src/monterl_carlo.erl
@@ -103,7 +103,6 @@ stop(Symbol) when is_binary(Symbol) ->
init([State]) ->
{ok, State}.
-
handle_call({graph,Type,Points}, _From, State) ->
P = lists:seq(1,Points),
@@ -157,7 +156,7 @@ handle_cast({subscribe,UpdateFun}, #state{interval=I} = State) ->
{noreply,State#state{updatefun=UpdateFun, timer= TRef}};
handle_cast(unsubscribe, #state{timer = TRef} = State) ->
timer:cancel(TRef),
- {noreply, State};
+ {noreply, State#state{loop_count = 0}};
handle_cast(stop,State) ->
{stop, normal, State};
handle_cast(_Msg, State) ->

0 comments on commit 60d5384

Please sign in to comment.