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

event.deinit is never called on shutdown #217

Closed
fhars opened this issue May 25, 2021 · 2 comments
Closed

event.deinit is never called on shutdown #217

fhars opened this issue May 25, 2021 · 2 comments

Comments

@fhars
Copy link

fhars commented May 25, 2021

The event.deinit callback is not called on shutdown, and event.init will be called again if you call OTA_Init after the agent has shutdown.

The two examples in os/portable happen to use methods (xQueueCreateStatic and mq_open) where this does not create issues, but in general it may lead to resource leaks, for example if someone happens to compile FreeRTOS without
#define configSUPPORT_STATIC_ALLOCATION 1
and then replaces that call with xQueueCreate.

@pvyawaha
Copy link
Contributor

Hello, Thank you for pointing this out, for non static implementations other than the two provided event.deinit must be called. We are working internally on a pull request to address this.

@ActoryOu
Copy link
Member

Hi,
To handle the race condition better, we don't reset the functions pointer when shutdown, including event queue, callback, etc.
So event.deinit is never called but there won't be any leakage because OTA will use same event queue at the next OTA_Init.

I'm going to close this issue. Any feedback is welcome.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants