diff options
author | Micael Karlberg <[email protected]> | 2011-11-09 14:05:51 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-11-09 14:05:51 +0100 |
commit | b27432ee4f0d0809ea668cd9e4fcb4f601652cbd (patch) | |
tree | 6b38ffc73fcd2af81c9ee988a485f91073f410e9 /lib/snmp/src/misc | |
parent | f561a98a9b89738467b52ab5213562de753f6ad2 (diff) | |
download | otp-b27432ee4f0d0809ea668cd9e4fcb4f601652cbd.tar.gz otp-b27432ee4f0d0809ea668cd9e4fcb4f601652cbd.tar.bz2 otp-b27432ee4f0d0809ea668cd9e4fcb4f601652cbd.zip |
Bad note store GC timer deactivation.
Wrong field in the state record was set (timeout instead active).
Stefan Grundmann
OTP-9690
Diffstat (limited to 'lib/snmp/src/misc')
-rw-r--r-- | lib/snmp/src/misc/snmp_note_store.erl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/snmp/src/misc/snmp_note_store.erl b/lib/snmp/src/misc/snmp_note_store.erl index a21a6209f1..23fccf8a5f 100644 --- a/lib/snmp/src/misc/snmp_note_store.erl +++ b/lib/snmp/src/misc/snmp_note_store.erl @@ -258,10 +258,17 @@ code_change({down, _Vsn}, State, _Extra) -> {ok, NState}; % upgrade -code_change(_Vsn, State, _Extra) -> +code_change(_Vsn, State0, _Extra) -> process_flag(trap_exit, true), - NState = restart_timer(State), - {ok, NState}. + State1 = + case State0 of + #state{timeout = false} -> + State0#state{timeout = ?timeout}; + _ -> + State0 + end, + State2 = restart_timer(State1), + {ok, State2}. %%---------------------------------------------------------- @@ -282,7 +289,7 @@ deactivate_timer(#state{timer = Pid, active = true} = State) -> receive deactivated -> ok end, - State#state{timeout = false}; + State#state{active = false}; deactivate_timer(State) -> State. |