Skip to content

Commit c260f7c

Browse files
spencersevillaSpencer Sevilla
authored and
Spencer Sevilla
committed
[core] allow for multiple fsm state transitions (#72)
1 parent 38790af commit c260f7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/core/ogs-fsm.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ void ogs_fsm_dispatch(void *sm, void *event)
6161
if (e)
6262
(*tmp)(s, e);
6363

64-
if (s->state != tmp) {
64+
while (s->state && s->state != tmp) {
6565
if (e) {
6666
e->id = OGS_FSM_EXIT_SIG;
6767
(*tmp)(s, e);
6868
} else {
6969
(*tmp)(s, &exit_event);
7070
}
71+
72+
tmp = s->state;
73+
7174
if (e) {
7275
e->id = OGS_FSM_ENTRY_SIG;
7376
(*s->state)(s, e);

0 commit comments

Comments
 (0)