This commit is contained in:
anlicheng 2025-06-03 13:59:51 +08:00
parent 5dc3ecd671
commit 20c22a0df7

View File

@ -400,7 +400,13 @@ handle_event(info, {'DOWN', MRef, process, TransportPid, Reason}, _, State = #st
%% terminate. It should be the opposite of Module:init/1 and do any
%% necessary cleaning up. When it returns, the gen_statem terminates with
%% Reason. The return value is ignored.
terminate(_Reason, _StateName, _State = #state{}) ->
terminate(_Reason, _StateName, _State = #state{transport_pid = TransportPid}) ->
case is_pid(TransportPid) andalso is_process_alive(TransportPid) of
true ->
efka_transport:stop(TransportPid);
false ->
ok
end,
ok.
%% @private