zenoh
zenoh copied to clipboard
Fix memory leaks
Addresses a series of memory leaks detected by valgrind (Fixes #695 ):
- due to cyclic references in Runtime and its dependents
- due to cyclic references in Session and its dependents
- due to cyclic references in Resource and its children
- due to cyclic reference in Mux->Face->State->Mux
- due to non-terminated tasks after Session.close()
Valgrind still reports some leaks, but they seem to be due to async_std (no mention of any Zenoh code, and similar "leaks" are also observed when running a simple hello world-type async example).
#566 is expected to land soon. I'd suggest to rebase this PR on #566 and to coordinate with @YuanYuYuan regarding task handling and management.
@DenisBiryukov91 What's the latest status of this PR? Also, would be great if you can add the timeline to the respective issue
@imstevenpmwork This was kind of finished for the main branch at the moment of last commit, but due to transition async-std->Tokyo, task termination part would likely need to be redone, so it is postponed until #566 is merged.