From: Matt Mullins Date: Tue, 15 Apr 2014 07:02:09 +0000 (-0700) Subject: irc_conn: cancel the timer when downgrading X-Git-Tag: v11~2 X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=69c963a9f741dea087eb41a964347e4788829bed;p=erlbot.git irc_conn: cancel the timer when downgrading --- diff --git a/irc/irc_conn.erl b/irc/irc_conn.erl index e28123e..6cdd81e 100644 --- a/irc/irc_conn.erl +++ b/irc/irc_conn.erl @@ -208,6 +208,8 @@ code_change(4, OldState, ok) -> {ok, NewState}; code_change({down, 4}, State, ok) -> + TimerRef = State#irc_state.ping_timer, + timer:cancel(TimerRef), {ok, list_to_tuple(lists:sublist(tuple_to_list(State), 9))}; code_change(_OldVsn, _State, _Extra) ->