Ignore:
Timestamp:
Oct 4, 2008, 2:57:26 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-04 Sam Weinig <[email protected]>

Reviewed by Oliver Hunt.

Fix https://bugs.webkit.org/show_bug.cgi?id=21320
leaks of PropertyNameArrayData seen on buildbot

  • Fix RefPtr cycle by making PropertyNameArrayData's pointer back to the StructureID a weak pointer.
  • kjs/PropertyNameArray.h: (JSC::PropertyNameArrayData::setCachedStructureID): (JSC::PropertyNameArrayData::cachedStructureID):
  • kjs/StructureID.cpp: (JSC::StructureID::getEnumerablePropertyNames): (JSC::StructureID::clearEnumerationCache): (JSC::StructureID::~StructureID):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/PropertyNameArray.h

    r36789 r37300  
    4242        PropertyNameVector& propertyNameVector() { return m_propertyNameVector; }
    4343
    44         void setCachedStructureID(PassRefPtr<StructureID> structureID) { m_cachedStructureID = structureID; }
    45         StructureID* cachedStructureID() const { return m_cachedStructureID.get(); }
     44        void setCachedStructureID(StructureID* structureID) { m_cachedStructureID = structureID; }
     45        StructureID* cachedStructureID() const { return m_cachedStructureID; }
    4646
    4747        void setCachedPrototypeChain(PassRefPtr<StructureIDChain> cachedPrototypeChain) { m_cachedPrototypeChain = cachedPrototypeChain; }
     
    5050    private:
    5151        PropertyNameArrayData()
     52            : m_cachedStructureID(0)
    5253        {
    5354        }
    5455
    5556        PropertyNameVector m_propertyNameVector;
    56         RefPtr<StructureID> m_cachedStructureID;
     57        StructureID* m_cachedStructureID;
    5758        RefPtr<StructureIDChain> m_cachedPrototypeChain;
    5859    };
Note: See TracChangeset for help on using the changeset viewer.