aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/gen_statem.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib/src/gen_statem.erl')
-rw-r--r--lib/stdlib/src/gen_statem.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/stdlib/src/gen_statem.erl b/lib/stdlib/src/gen_statem.erl
index 486f61b1ed..e03e22b087 100644
--- a/lib/stdlib/src/gen_statem.erl
+++ b/lib/stdlib/src/gen_statem.erl
@@ -459,13 +459,13 @@ do_send(Proc, Msg) ->
enter(Module, Options, State, StateData, Server, InitOps, Parent) ->
Name = gen:get_proc_name(Server),
Debug = gen:debug_options(Name, Options),
- PrevState = make_ref(),
+ PrevState = undefined,
S = #{
callback_mode => state_functions,
module => Module,
name => Name,
prev_state => PrevState,
- state => PrevState,
+ state => PrevState, % Will be discarded by loop_event_state_ops
state_data => StateData,
timer => undefined,
postponed => [],
@@ -475,7 +475,8 @@ enter(Module, Options, State, StateData, Server, InitOps, Parent) ->
loop_event_state_ops(
Parent, Debug,
S#{callback_mode := CallbackMode},
- [], {event,undefined},
+ [],
+ {event,undefined}, % Will be discarded by {postpone,false}
State, StateData,
StateOps++[{postpone,false}]);
[Reason] ->