From 1988057f603b7dce95b39084b570a649d859c8b9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 3 Apr 2023 23:02:21 -0400 Subject: [PATCH] Fix mdns client example shutdown sequence. (#25889) 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 https://github.com/project-chip/connectedhomeip/issues/8917 --- examples/minimal-mdns/client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/minimal-mdns/client.cpp b/examples/minimal-mdns/client.cpp index 397049c50ce8d6..6aa9c16cfb1ab0 100644 --- a/examples/minimal-mdns/client.cpp +++ b/examples/minimal-mdns/client.cpp @@ -342,7 +342,6 @@ int main(int argc, char ** args) gMdnsServer.Shutdown(); DeviceLayer::PlatformMgr().StopEventLoopTask(); - DeviceLayer::PlatformMgr().Shutdown(); }, nullptr); if (err != CHIP_NO_ERROR) @@ -352,6 +351,9 @@ int main(int argc, char ** args) DeviceLayer::PlatformMgr().RunEventLoop(); + DeviceLayer::PlatformMgr().Shutdown(); + Platform::MemoryShutdown(); + printf("Done...\n"); return 0; }