Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete the ChipEventQueue and BackgroundEventQueue after returning from the event loop. #37489

Merged
merged 4 commits into from
Feb 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ 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(NULL);
jadhavrohit924 marked this conversation as resolved.
Show resolved Hide resolved
vQueueDelete(static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->mChipEventQueue);
jadhavrohit924 marked this conversation as resolved.
Show resolved Hide resolved
static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->mChipEventQueue = NULL;
jadhavrohit924 marked this conversation as resolved.
Show resolved Hide resolved
}

template <class ImplClass>
Expand Down Expand Up @@ -377,6 +377,9 @@ void GenericPlatformManagerImpl_FreeRTOS<ImplClass>::BackgroundEventLoopTaskMain
{
ChipLogDetail(DeviceLayer, "CHIP background task running");
static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->Impl()->RunBackgroundEventLoop();
vTaskDelete(NULL);
vQueueDelete(static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->mBackgroundEventQueue);
jadhavrohit924 marked this conversation as resolved.
Show resolved Hide resolved
static_cast<GenericPlatformManagerImpl_FreeRTOS<ImplClass> *>(arg)->mBackgroundEventQueue = NULL;
}
#endif

Expand Down
Loading