Skip to content

Commit

Permalink
Merge pull request #31 from meulemanelectronics/TSBM-485
Browse files Browse the repository at this point in the history
TSBM-485 Properly delete task.
  • Loading branch information
n-nievergeld authored Dec 18, 2024
2 parents 9cd9c09 + b421aa0 commit 52010b8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ void GenericPlatformManagerImpl_FreeRTOS<ImplClass>::EventLoopTaskMain(void * ar
{
ChipLogDetail(DeviceLayer, "CHIP event task running");
static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->Impl()->RunEventLoop();
// TODO: At this point, should we not
// vTaskDelete(static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->mEventLoopTask)?
// Or somehow get our caller to do it once this thread is joined?
vTaskDelete(static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->mEventLoopTask);
}

template <class ImplClass>
Expand Down Expand Up @@ -423,7 +421,8 @@ template <class ImplClass>
CHIP_ERROR GenericPlatformManagerImpl_FreeRTOS<ImplClass>::_StopEventLoopTask(void)
{
mShouldRunEventLoop.store(false);
return CHIP_NO_ERROR;
ChipDeviceEvent noop{ .Type = DeviceEventType::kNoOp };
return DeviceLayer::PlatformMgr().PostEvent(&noop);
}

// Fully instantiate the generic implementation class in whatever compilation unit includes this file.
Expand Down

0 comments on commit 52010b8

Please sign in to comment.