On Wed, Jan 28, 2009 at 07:20:38PM +0000, Jeremy Henty wrote:
This shows up under valgrind as a leak when the HTML includes an <img usemap="...">. Patch attached.
In the second part of the patch, Why not: void Image::setUseMap (ImageMapsList *list, object::Object *key) { mapList = list; + if (mapKey && mapKey != key) + delete mapKey; mapKey = key; }
# HG changeset patch # User Jeremy Henty <onepoint@starurchin.org> # Date 1233170119 0 # Node ID 0f662866abb4ab30f50a2da66432eff7fda8ec7a # Parent ff6f4530c0f4dc880503d73faf5d2d828d577678 [mq]: fix-images-leak-mapkey
diff --git a/dw/image.cc b/dw/image.cc --- a/dw/image.cc +++ b/dw/image.cc @@ -140,6 +140,8 @@ delete altText; if (buffer) buffer->unref (); + if (mapKey) + delete mapKey; }
void Image::sizeRequestImpl (core::Requisition *requisition) @@ -401,7 +403,12 @@ void Image::setUseMap (ImageMapsList *list, object::Object *key) { mapList = list; - mapKey = key; + if (key != mapKey) { + object::Object *oldKey = mapKey; + mapKey = key; + if (oldKey) + delete oldKey; + } }
} // namespace dw
-- Cheers Jorge.- ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________