[x264-devel] libx264 memory leak

Sean McGovern gseanmcg at gmail.com
Tue Mar 3 16:24:34 CET 2009


Windows DLLs have equivalent functionality within the DllMain entry point.

-----Original Message-----
From: Leon Woestenberg <leon.woestenberg at gmail.com>

Date: Tue, 3 Mar 2009 16:10:58 
To: Mailing list for x264 developers<x264-devel at videolan.org>
Subject: Re: [x264-devel] libx264 memory leak


Hello,

On Tue, Mar 3, 2009 at 11:19 AM, Jason Garrett-Glaser
<darkshikari at gmail.com> wrote:
> 2009/3/3 191919 <191919 at gmail.com>:
>> I found a memory leak in x264_mb_analyse_load_costs. It keeps some
>> x264_malloc'ed pointer to a global array, but no one remembers to free them
>> in x264_encoder_close.
>>
>
> This is intentional.  Because the arrays are static, if libx264 is
> called multiple times from the same application, it will not need to
> allocate them separately for each process, thus saving memory.
>

Under Unices, using a library constructor/destructor approach is available:

http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html#INIT-AND-CLEANUP

Not sure how Windows handles that though,

Regards,
-- 
Leon
_______________________________________________
x264-devel mailing list
x264-devel at videolan.org
http://mailman.videolan.org/listinfo/x264-devel


More information about the x264-devel mailing list