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 committed Dec 6, 2022
1 parent b149561 commit e50547f
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 e50547f

Please sign in to comment.