Skip to content

Commit

Permalink
Conduct platform shutdown after RunEventLoop returns (#8255)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored and pull[bot] committed Aug 19, 2021
1 parent 53af3b0 commit 2319616
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/messaging/tests/echo/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ void InitializeChip(void)

void ShutdownChip(void)
{
chip::DeviceLayer::PlatformMgr().StopEventLoopTask();
chip::DeviceLayer::PlatformMgr().Shutdown();
gMessageCounterManager.Shutdown();
gExchangeManager.Shutdown();
Expand Down
11 changes: 4 additions & 7 deletions src/messaging/tests/echo/echo_requester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ void EchoTimerHandler(chip::System::Layer * systemLayer, void * appState, CHIP_E
if (err != CHIP_NO_ERROR)
{
printf("Send request failed: %s\n", chip::ErrorStr(err));
Shutdown();
chip::DeviceLayer::PlatformMgr().StopEventLoopTask();
}
}
else
{
Shutdown();
chip::DeviceLayer::PlatformMgr().StopEventLoopTask();
}
}

Expand Down Expand Up @@ -276,12 +276,9 @@ int main(int argc, char * argv[])

chip::DeviceLayer::PlatformMgr().RunEventLoop();

exit:
if (err != CHIP_NO_ERROR)
{
Shutdown();
}
Shutdown();

exit:
if ((err != CHIP_NO_ERROR) || (gEchoRespCount != kMaxEchoCount))
{
printf("ChipEchoClient failed: %s\n", chip::ErrorStr(err));
Expand Down

0 comments on commit 2319616

Please sign in to comment.