Skip to content

Commit

Permalink
Refactor event dispatch to handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-yolabs authored and linkmonitor committed May 23, 2024
1 parent c76d9ec commit 9a1b473
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions eventrouter/internal/eventrouter_baremetal.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ void ErReturnToSender(ErEvent_t *a_event)
ErListRemove(&s_context.m_events.m_kept, &a_event->m_next);

// All subscribed modules have received the event; return to its sender.
a_event->m_sending_module->m_handler(
a_event, a_event->m_sending_module->m_context);
ErModule_t *sender = a_event->m_sending_module;
sender->m_handler(a_event, sender->m_context);
}
}

Expand Down
4 changes: 2 additions & 2 deletions eventrouter/internal/eventrouter_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ void ErReturnToSender(ErEvent_t *a_event)
// support the optimization mentioned a few lines up.
if (atomic_load(&a_event->m_reference_count) == 0)
{
a_event->m_sending_module->m_handler(
a_event, a_event->m_sending_module->m_context);
ErModule_t *sender = a_event->m_sending_module;
sender->m_handler(a_event, sender->m_context);
}
}

Expand Down

0 comments on commit 9a1b473

Please sign in to comment.