Leaking image structures
On Wed, Feb 18, 2009 at 08:26:52AM +0000, corvid wrote:
On Wed, Feb 18, 2009 at 12:40:57AM +0000, corvid wrote:
Can you please try attached patch with valgrind and image loading on and off.
Is this a proposed patch for the tree or an experiment in leak-finding?
For the tree, if it proofs to fix the leaks and doesn't cause others.
If we always add Image, the code that loads images manually will think it hasn't been loaded yet.
Ah ok. I guess I misunderstood Html_add_new_linkimage() completely. Please check the updated patch. Thanks, Johannes PS: The point of the patch is to actually do reference counting: Whenever we create a new reference (pointer) to an image, we call a_Image_ref(), when such a pointer is deleted we call a_Image_unref(). If I see it correctly, the permanent pointers to Image structures are in html->images and in the DilloWeb structure.
Johannes wrote:
On Wed, Feb 18, 2009 at 08:26:52AM +0000, corvid wrote:
On Wed, Feb 18, 2009 at 12:40:57AM +0000, corvid wrote:
Can you please try attached patch with valgrind and image loading on and off.
Is this a proposed patch for the tree or an experiment in leak-finding?
For the tree, if it proofs to fix the leaks and doesn't cause others.
If we always add Image, the code that loads images manually will think it hasn't been loaded yet.
Ah ok. I guess I misunderstood Html_add_new_linkimage() completely. Please check the updated patch.
Thanks, Johannes
PS: The point of the patch is to actually do reference counting: Whenever we create a new reference (pointer) to an image, we call a_Image_ref(), when such a pointer is deleted we call a_Image_unref(). If I see it correctly, the permanent pointers to Image structures are in html->images and in the DilloWeb structure.
It's bedtime now, so I haven't looked at this carefully yet, but you might need an unref in DilloHtml::loadImages() then.
On Wed, Feb 18, 2009 at 09:13:57AM +0000, corvid wrote:
Johannes wrote:
On Wed, Feb 18, 2009 at 08:26:52AM +0000, corvid wrote:
On Wed, Feb 18, 2009 at 12:40:57AM +0000, corvid wrote:
Can you please try attached patch with valgrind and image loading on and off.
Is this a proposed patch for the tree or an experiment in leak-finding?
For the tree, if it proofs to fix the leaks and doesn't cause others.
If we always add Image, the code that loads images manually will think it hasn't been loaded yet.
Ah ok. I guess I misunderstood Html_add_new_linkimage() completely. Please check the updated patch.
Thanks, Johannes
PS: The point of the patch is to actually do reference counting: Whenever we create a new reference (pointer) to an image, we call a_Image_ref(), when such a pointer is deleted we call a_Image_unref(). If I see it correctly, the permanent pointers to Image structures are in html->images and in the DilloWeb structure.
It's bedtime now, so I haven't looked at this carefully yet, but you might need an unref in DilloHtml::loadImages() then.
Yes. Updated patch attached.
On Wed, Feb 18, 2009 at 05:06:16PM +0100, Hofmann Johannes wrote:
Yes. Updated patch attached.
OK, I'm running with this patch. Since I don't have reproducible test cases I can't say right away whether it works. Keep an eye on my valgrind log page (it updates every night). http://starurchin.org/dillo/valgrind.html BTW, it seems that the CSS leaks stopped about three days ago. Yay! Regards, Jeremy Henty
participants (3)
-
corvid@lavabit.com
-
Johannes.Hofmann@gmx.de
-
onepoint@starurchin.org