[Ffmpeg-devel] [PATCH] Call av_free_static automatically before DLL unload

Michael Niedermayer michaelni
Sun Aug 21 21:50:57 CEST 2005


On Mon, Aug 15, 2005 at 11:55:18PM +0200, plaum at ipf.uni-stuttgart.de wrote:
> Hi all,
> 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.




More information about the ffmpeg-devel mailing list