Changeset 94831 in webkit


Ignore:
Timestamp:
Sep 8, 2011 8:20:59 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Release the reference to the HTMLPlugInElement's script object, when the element is removed from the document. This breaks a cyclical reference that would otherwise cause the element to be retained until the document is torn down.
https://bugs.webkit.org/show_bug.cgi?id=66181

Patch by James Weatherall <wez@chromium.org> on 2011-09-08
Reviewed by Anders Carlsson.

No new tests - no functional change.

  • html/HTMLPlugInElement.cpp:

(WebCore::HTMLPlugInElement::removedFromDocument):

  • html/HTMLPlugInElement.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r94828 r94831  
     12011-09-08  James Weatherall  <wez@chromium.org>
     2
     3        Release the reference to the HTMLPlugInElement's script object, when the element is removed from the document.  This breaks a cyclical reference that would otherwise cause the element to be retained until the document is torn down.
     4        https://bugs.webkit.org/show_bug.cgi?id=66181
     5
     6        Reviewed by Anders Carlsson.
     7
     8        No new tests - no functional change.
     9
     10        * html/HTMLPlugInElement.cpp:
     11        (WebCore::HTMLPlugInElement::removedFromDocument):
     12        * html/HTMLPlugInElement.h:
     13
    1142011-09-08  Daniel Bates  <dbates@webkit.org>
    215
  • trunk/Source/WebCore/html/HTMLPlugInElement.cpp

    r91404 r94831  
    8080
    8181    HTMLFrameOwnerElement::detach();
     82}
     83
     84void HTMLPlugInElement::removedFromDocument()
     85{
     86#if ENABLE(NETSCAPE_PLUGIN_API)
     87    if (m_NPObject) {
     88        _NPN_ReleaseObject(m_NPObject);
     89        m_NPObject = 0;
     90    }
     91#endif
     92
     93    HTMLFrameOwnerElement::removedFromDocument();
    8294}
    8395
  • trunk/Source/WebCore/html/HTMLPlugInElement.h

    r91404 r94831  
    5858
    5959    virtual void detach();
    60 
     60    virtual void removedFromDocument();
    6161    virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
    6262    virtual void parseMappedAttribute(Attribute*);
Note: See TracChangeset for help on using the changeset viewer.