Skip to content

Commit

Permalink
Fix mdns client example shutdown sequence. (#25889)
Browse files Browse the repository at this point in the history
Shutting down the platform manager while the event loop is not fully shut down
(which is the case when StopEventLoopTask is called from inside the event loop
itself) is not supported.

Fixes #8917
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Feb 12, 2024
1 parent a82fe63 commit 4a709dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/minimal-mdns/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ int main(int argc, char ** args)
gMdnsServer.Shutdown();

DeviceLayer::PlatformMgr().StopEventLoopTask();
DeviceLayer::PlatformMgr().Shutdown();
},
nullptr);
if (err != CHIP_NO_ERROR)
Expand All @@ -352,6 +351,9 @@ int main(int argc, char ** args)

DeviceLayer::PlatformMgr().RunEventLoop();

DeviceLayer::PlatformMgr().Shutdown();
Platform::MemoryShutdown();

printf("Done...\n");
return 0;
}

0 comments on commit 4a709dd

Please sign in to comment.