Skip to content

Commit

Permalink
event_handler: Allows removal of eventHandler in eventHandler->Handler (
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored and pull[bot] committed Mar 23, 2023
1 parent 5450a79 commit 6692e4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/include/platform/internal/GenericPlatformManagerImpl.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,11 @@ template <class ImplClass>
void GenericPlatformManagerImpl<ImplClass>::DispatchEventToApplication(const ChipDeviceEvent * event)
{
// Dispatch the event to each of the registered application event handlers.
for (AppEventHandler * eventHandler = mAppEventHandlerList; eventHandler != nullptr; eventHandler = eventHandler->Next)
for (AppEventHandler * eventHandler = mAppEventHandlerList; eventHandler != nullptr;)
{
AppEventHandler * nextEventHandler = eventHandler->Next;
eventHandler->Handler(event, eventHandler->Arg);
eventHandler = nextEventHandler;
}
}

Expand Down

0 comments on commit 6692e4f

Please sign in to comment.