Re: [gmime-devel] Possible memory leakage in gmime



Vsevolod Stakhov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I'm using gmime (ver 2.2.21) for writing spam filter and found that I
> have strange memory issues with it. I wrote a simple test, that can be
> found here:
> http://cebka.pp.ru/stuff/test_gmime_mem.c
>
> In short words it process in infinite cycle messages from command line
> (using mmapped memory to repeat conditions in my filter). When I run
> this test it uses more and more memory (memory usage increasing rate is
> not very high but it is definitely exists).
>
>   
Okay, I found the problem. In your test program, you make a call to
g_mime_part_get_content_object(). This returns a ref'd instance of a
GMimeDataWrapper which your test program isn't unref'ing.

After the line "g_object_unref (part_stream);", add "g_object_unref
(wrapper);" and the leak should disappear.

Jeff


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]