From ae8ca4a264b29dbee12de4cdbbb5d54e778bcf06 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Wed, 7 May 2025 11:06:47 +0800 Subject: [PATCH] esp_matter: Fix thread unsafe usage when rebooting a provisioned Thread device --- components/esp_matter/esp_matter_core.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp index e787d2865..26aa8044c 100644 --- a/components/esp_matter/esp_matter_core.cpp +++ b/components/esp_matter/esp_matter_core.cpp @@ -900,7 +900,9 @@ esp_err_t start(event_callback_t callback, intptr_t callback_arg) // If Thread is Provisioned, publish the dns service if (chip::DeviceLayer::ConnectivityMgr().IsThreadProvisioned() && (chip::Server::GetInstance().GetFabricTable().FabricCount() != 0)) { - chip::app::DnssdServer::Instance().StartServer(); + + PlatformMgr().ScheduleWork([](intptr_t){ chip::app::DnssdServer::Instance().StartServer(); }, + reinterpret_cast(nullptr)); } #endif // CONFIG_ESP_MATTER_ENABLE_OPENTHREAD #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD