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

Memory leak in event handling of readlog.jl #62

Open
venabled opened this issue Mar 8, 2019 · 3 comments
Open

Memory leak in event handling of readlog.jl #62

venabled opened this issue Mar 8, 2019 · 3 comments

Comments

@venabled
Copy link

venabled commented Mar 8, 2019

Right now there's no call to liblcm implementation of lcm_eventlog_free_event .

I've currently manually implemented it as:

function lcm_event_destroy(event::Ptr{LCMCore.lcm_eventlog_event_t})
    ccall(
    (:lcm_eventlog_free_event, LCMCore.liblcm),
    Cvoid,
    (Ptr{LCMCore.lcm_eventlog_event_t}, ),
    event
    )
end

But otherwise, when iterating event by event through a log file, the allocated memory is never cleared.

dehann added a commit that referenced this issue May 5, 2019
related to #62 but not a complete fix yet
@dehann
Copy link
Member

dehann commented May 5, 2019

Hi @venabled , thanks for posting. When do you suggest the calling the event_destroy function -- after the user has finished in the callback function?

@dehann
Copy link
Member

dehann commented May 5, 2019

copied the new function in here (Thanks!)
e30e44b

@venabled
Copy link
Author

venabled commented May 5, 2019

I was using it mostly in Log-file reading, so didn't have a "callback" per se, but I think that would be a good default place to have it.

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

2 participants