diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 8649efc69358f9..e511ebb9795325 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -453,7 +453,7 @@ void CHIPCommand::StopWaiting() #endif // CONFIG_USE_SEPARATE_EVENTLOOP } -void CHIPCommand::ExecuteDeferredCleanups() +void CHIPCommand::ExecuteDeferredCleanups(intptr_t ignored) { for (auto * cmd : sDeferredCleanups) { diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 7688a34873bfbe..02a30eb28ee2dc 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -115,7 +115,7 @@ class CHIPCommand : public Command virtual bool DeferInteractiveCleanup() { return false; } // Execute any deferred cleanups. Used when exiting interactive mode. - void ExecuteDeferredCleanups(); + static void ExecuteDeferredCleanups(intptr_t ignored); #ifdef CONFIG_USE_LOCAL_STORAGE PersistentStorage mDefaultStorage; diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp index 33b030acb335c7..38e706b119e056 100644 --- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp +++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp @@ -89,7 +89,7 @@ bool InteractiveStartCommand::ParseCommand(char * command) { if (strcmp(command, kInteractiveModeStopCommand) == 0) { - ExecuteDeferredCleanups(); + chip::DeviceLayer::PlatformMgr().ScheduleWork(ExecuteDeferredCleanups, 0); return false; }