Feature #4692
Updated by Davide Pesavento over 6 years ago
`SegmentFetcher::start` Static start function returns a `shared_ptr`, shared_ptr, but this `shared_ptr` shared_ptr is kept alive internally by the `SegmentFetcher` instance itself, so even if the returned `shared_ptr` goes out for internal use of scope, the `SegmentFetcher` is not destructed. segment fetcher. In PSync #4662 (and maybe NLSR #4682) when a test completes successfully without error, ASan and valgrind reports leak due to segment fetcher start being called such that there is no expectation of data (start is called because the application is supposed to send the interest upon getting data). The io is already stopped given that the test is successfully terminated. If `advanceClocks` advance clocks is run for 60 seconds (maxTimeout) the segment fetcher destructs and no leaks are reported. If a stop/cancel stop function is provided it can be called in the application's destructor. Another use case is when a previous interest needs to be cancelled and a new interest needs to be sent in its place. Given the async nature of segment fetcher - not sure how this can be accomplished.