diff --git a/examples/placeholder/linux/include/TestCommand.h b/examples/placeholder/linux/include/TestCommand.h index b9204f2d6702b9..7bd4d3b6e8497b 100644 --- a/examples/placeholder/linux/include/TestCommand.h +++ b/examples/placeholder/linux/include/TestCommand.h @@ -111,7 +111,6 @@ class TestCommand : public TestRunner, TestCommand * command = reinterpret_cast(context); command->isRunning = true; command->NextTest(); - chip::DeviceLayer::PlatformMgr().RemoveEventHandler(OnPlatformEvent, context); } static void OnPlatformEvent(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) @@ -121,6 +120,7 @@ class TestCommand : public TestRunner, case chip::DeviceLayer::DeviceEventType::kCommissioningComplete: ChipLogProgress(chipTool, "Commissioning complete"); chip::DeviceLayer::PlatformMgr().ScheduleWork(ScheduleNextTest, arg); + chip::DeviceLayer::PlatformMgr().RemoveEventHandler(OnPlatformEvent, arg); break; } } @@ -129,7 +129,7 @@ class TestCommand : public TestRunner, { if (commandPath == mCommandPath) { - NextTest(); + chip::DeviceLayer::PlatformMgr().ScheduleWork(ScheduleNextTest, reinterpret_cast(this)); return; } @@ -141,7 +141,7 @@ class TestCommand : public TestRunner, { if (attributePath == mAttributePath) { - NextTest(); + chip::DeviceLayer::PlatformMgr().ScheduleWork(ScheduleNextTest, reinterpret_cast(this)); return; }