Skip to content
  • darin's avatar
    Reviewed by John Sullivan. · cfc43863
    darin authored
            - fixed storage leaks; one of the leaks caused these 3 bugs:
    
            <rdar://problem/4231952> leaks of DOMStringImpl called from HTMLTokenizer::processToken, seen running WebKit tests
            <http://bugzilla.opendarwin.org/show_bug.cgi?id=4797>
    
            <rdar://problem/4233800> leak inside DOM::DocumentImpl::DocumentImpl, seen running webkit tests
            <http://bugzilla.opendarwin.org/show_bug.cgi?id=4795>
    
            <rdar://problem/4232812> leaks of NodeImpl called from HTMLParser::textCreateErrorCheck, seen running webkit tests
            <http://bugzilla.opendarwin.org/show_bug.cgi?id=4796>
    
            * khtml/html/html_elementimpl.cpp:
            (HTMLElementImpl::setOuterHTML): Put ref/deref around call to replaceChild to avoid leaking the node being replaced.
            (HTMLElementImpl::setOuterText): Put ref/deref around call to replaceChild to avoid leaking the node being replaced.
            Also changed removeChild calls to use remove instead, both for simplicity and to fix the leak without having
            to add a SharedPtr or ref/deref pair.
    
            * khtml/html/html_tableimpl.cpp:
            (DOM::HTMLTableElementImpl::setCaption): Put ref/deref around call to replaceChild to avoid leaking the node being
            replaced.
            (DOM::HTMLTableElementImpl::setTHead): Ditto.
            (DOM::HTMLTableElementImpl::setTFoot): Ditto.
            (DOM::HTMLTableElementImpl::setTBody): Tweaked a bit to match the other functions as closely as possible.
            No leak here.
    
            * khtml/xml/dom_nodeimpl.cpp:
            (DOM::NodeImpl::remove): Added ref/deref to avoid leaking the node being removed.
            (DOM::NodeImpl::normalize): Changed two calls to removeChild to calls to remove to prevent leaks.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    cfc43863