⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 117792 in webkit


Ignore:
Timestamp:
May 21, 2012, 9:19:58 AM (14 years ago)
Author:
schenney@chromium.org
Message:

SVGAnimatedPropertyTearOff does not clear a self pointer on deletion
https://bugs.webkit.org/show_bug.cgi?id=86119

Reviewed by Nikolas Zimmermann.

Source/WebCore:

SVGAnimatedPropertyTearOff contains two SVGPropertyTearOff objects
that have a pointer back to the SVGAnimatedPropertyTearOff. JS may
also have a reference to these SVGPropertyTearOff objects. When the
SVGAnimatedPropertyTearOff is deleted, the SVGPropertyTearOff objects
may live on, but the pointer back to the deleted animated property
tear off is left invalid. This patch clears the pointers on destruction
of the SVGAnimatedPropertyTearOff.

Test: svg/custom/bug86119.html

  • svg/properties/SVGAnimatedPropertyTearOff.h:

(WebCore::SVGAnimatedPropertyTearOff::~SVGAnimatedPropertyTearOff):
(SVGAnimatedPropertyTearOff):

LayoutTests:

  • svg/custom/bug86119.html: Added.
  • svg/custom/bug86119-expected.txt: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117791 r117792  
     12012-05-21  Stephen Chenney  <schenney@chromium.org>
     2
     3        SVGAnimatedPropertyTearOff does not clear a self pointer on deletion
     4        https://bugs.webkit.org/show_bug.cgi?id=86119
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        * svg/custom/bug86119.html: Added.
     9        * svg/custom/bug86119-expected.txt: Added.
     10
    1112012-05-21  Luke Macpherson  <macpherson@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r117790 r117792  
     12012-05-21  Stephen Chenney  <schenney@chromium.org>
     2
     3        SVGAnimatedPropertyTearOff does not clear a self pointer on deletion
     4        https://bugs.webkit.org/show_bug.cgi?id=86119
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        SVGAnimatedPropertyTearOff contains two SVGPropertyTearOff objects
     9        that have a pointer back to the SVGAnimatedPropertyTearOff. JS may
     10        also have a reference to these SVGPropertyTearOff objects. When the
     11        SVGAnimatedPropertyTearOff is deleted, the SVGPropertyTearOff objects
     12        may live on, but the pointer back to the deleted animated property
     13        tear off is left invalid. This patch clears the pointers on destruction
     14        of the SVGAnimatedPropertyTearOff.
     15
     16        Test: svg/custom/bug86119.html
     17
     18        * svg/properties/SVGAnimatedPropertyTearOff.h:
     19        (WebCore::SVGAnimatedPropertyTearOff::~SVGAnimatedPropertyTearOff):
     20        (SVGAnimatedPropertyTearOff):
     21
    1222012-05-21  Stephen Chenney  <schenney@chromium.org>
    223
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h

    r116451 r117792  
    3232    typedef SVGPropertyTearOff<PropertyType> PropertyTearOff;
    3333    typedef PropertyType ContentType;
     34
     35    virtual ~SVGAnimatedPropertyTearOff()
     36    {
     37        if (m_baseVal) {
     38            ASSERT(m_baseVal->animatedProperty() == this);
     39            m_baseVal->setAnimatedProperty(0);
     40        }
     41        if (m_animVal) {
     42            ASSERT(m_animVal->animatedProperty() == this);
     43            m_animVal->setAnimatedProperty(0);
     44        }
     45    }
    3446
    3547    PropertyTearOff* baseVal()
Note: See TracChangeset for help on using the changeset viewer.