LCMCore.jl
LCMCore.jl copied to clipboard
Memory leak in event handling of readlog.jl
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.
Hi @venabled , thanks for posting. When do you suggest the calling the event_destroy function -- after the user has finished in the callback function?
copied the new function in here (Thanks!) e30e44b
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.