Hello,
I’m working on a microcontroller-based diagnostic-tool for a openCyphal Network. I use the sourcecode generated by nunavut. (nnvg.exe) an CANARD_VERSION_MAJOR 3
In the diagnostic tool I can enter a menu for cyphal-diagnostic and leave the menu again, which should uninitialize everything that is allocated by malloc. I call canardRxUnsubscribe() for all subscriptions.
To find malloc/free errors in my application I track the amount of allocated and freed memory when I enter/leave a menu. Now it seems that when I quit the cyphal diagnostic menu while the CAN-bus is working, 1-2 mallocs are not freed, each time I enter/exit this menu another 1-2 mallocs are not freed.
When there is no CAN-traffic during enter/exit this diagnostic-menu, the amount of allocated memory is correct
My assumption is that there are unprocessed receive data in the receive buffers. I assume the receive-function allocates the required memory for payload-size, and this payload is freed when the receive-data is processed.
Would canardRxUnsubscribe() clear any remaining data from the recevie-buffers?
Or is there another function that I can call to free all allocated memory from the receive-buffers?
Regards,
Gunnar
Problem solved, a typo in my unsubscribe function. One subject was not unsubscribed…