[Ffmpeg-devel] [PATCH] Call av_free_static automatically before DLL unload
plaum at ipf.uni-stuttgart.de
Mon Aug 15 23:55:18 CEST 2005
this patch calls av_free_static() automatically, before the module
(statically linked executable or shared lib) gets unloaded.
This prevents a potential memory leak in plugin based applications,
where the right time for calling av_free_static() isn't always known.
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes
displays zero lost bytes (in lavc at least) now.
It utilizes the __attribute__ ((destructor)) mechanism, which is supported
since (at least) gcc-2.95 for all target formats. It has been used in
libquicktime for many years on many platforms without a single problem.
Programs, which call av_free_static() explicitely don't have to be
changed, since multiple calls are harmless.
If any problems arise, I'll look after them.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 634 bytes
Desc: not available
More information about the ffmpeg-devel