Patch for removeAttributeNode

David Faure faure at kde.org
Sun Jun 29 00:53:34 CEST 2003


On Saturday 28 June 2003 03:52, Dirk Mueller wrote:
> On Fre, 27 Jun 2003, David Faure wrote:
> 
> > (The "false" doesn't matter, it's ignored). AFAICS this doesn't introduce a memleak
> 
> it doesn't introduce a memory leak, but its still wrong. why cloning the 
> attribute node? it should return the old node, not a clone of it :)
>
> The real question is why value is suddenly becoming null..

That's quite obvious:

    if (attr->_value) {
        attr->_value->deref();
        attr->_value = 0;
        if (element)
            element->parseAttribute(attr);
    }

at the end of NamedAttrMapImpl::removeAttribute().

Since this modifies "attr", I need a clone of it, one with the value still set...

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html


More information about the Khtml-devel mailing list