From 32fbf33e61ed13c728e4efcbd8729171391c472f Mon Sep 17 00:00:00 2001 From: Burkhard Plaum Date: Sun, 21 Aug 2005 19:50:22 +0000 Subject: [PATCH] Call av_free_static automatically before DLL unload patch by (plaum:ipf uni-stuttgart de) Originally committed as revision 4532 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/utils.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1b2cd21645..f2a8ae0001 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -143,6 +143,17 @@ void av_free_static(void) av_freep(&array_static); } +/** + * Call av_free_static automatically before it's too late + */ + +static void do_free() __attribute__ ((destructor)); + +static void do_free() +{ + av_free_static(); +} + /** * Frees memory and sets the pointer to NULL. * @param arg pointer to the pointer which should be freed