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 Sep 6, 2024
1 parent 8290f15 commit 6005317
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 6005317

Please sign in to comment.