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/StructureID.cpp

    r36977 r37300  
    8282
    8383    if (shouldCache) {
     84        if (m_cachedPropertyNameArrayData)
     85            m_cachedPropertyNameArrayData->setCachedStructureID(0);
     86
    8487        m_cachedPropertyNameArrayData = propertyNames.data();
    8588
     
    9497void StructureID::clearEnumerationCache()
    9598{
     99    if (m_cachedPropertyNameArrayData)
     100        m_cachedPropertyNameArrayData->setCachedStructureID(0);
    96101    m_cachedPropertyNameArrayData.clear();
    97102}
     
    183188        m_previous->m_transitionTable.remove(make_pair(m_nameInPrevious, m_attributesInPrevious));
    184189    }
     190
     191    if (m_cachedPropertyNameArrayData)
     192        m_cachedPropertyNameArrayData->setCachedStructureID(0);
    185193}
    186194
Note: See TracChangeset for help on using the changeset viewer.