[Ffmpeg-devel] Re: [PATCH] Call av_free_static automatically before DLL unload
Tue Aug 16 22:24:17 CEST 2005
> Wouldn't such a patch be cleaner ?
Ok, I just tried it and it works for me (gcc-Version 3.4.4, Linux x86).
Some remarks, why I did it the way I did it:
I don't know, if it's a good idea to make a function both
__attribute__ desctructor and publicly visible. On some targets,
the destructor attribute causes the function to be placed in a different
section of the object file (fini section for elf). If such a function is
callable like any other for all object formats, is beyond my knowlegde
(see above, for Linux/ELF it works fine).
Putting the __attribute__ ((destructor)) in the prototype is due to
the fact, that all examples, I found, did it this way too. IIRC, some
earlier gcc versions failed to compile code where the attribute was defined
in the definition only.
More information about the ffmpeg-devel