Ignore:
Timestamp:
Mar 14, 2011, 1:40:49 PM (14 years ago)
Author:
[email protected]
Message:

<http://webkit.org/b/56304> REGRESSION(r80892): 100,000+ leaks seen on the build bot

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

  • API/JSClassRef.cpp:

(OpaqueJSClass::OpaqueJSClass): Don't leak any existing entry for the given name if
the class definition contains duplicates. This also removes what look to be leaks
of the StringImpl instances that are used as keys: the HashMap key type is a RefPtr
which retains / releases the instances at the appropriate time, so explicitly calling
ref is not necessary.

Tools:

  • DumpRenderTree/LayoutTestController.cpp:

(LayoutTestController::staticFunctions): Remove duplicate entries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSClassRef.cpp

    r78634 r81051  
    8585                StaticValueEntry* entry = new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes);
    8686                StringImpl* impl = valueName.impl();
    87                 impl->ref();
    88                 m_staticValues->add(impl, entry);
     87                StaticValueEntry* existingEntry = m_staticValues->get(impl);
     88                m_staticValues->set(impl, entry);
     89                delete existingEntry;
    8990            }
    9091            ++staticValue;
     
    100101                StaticFunctionEntry* entry = new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes);
    101102                StringImpl* impl = functionName.impl();
    102                 impl->ref();
    103                 m_staticFunctions->add(impl, entry);
     103                StaticFunctionEntry* existingEntry = m_staticFunctions->get(impl);
     104                m_staticFunctions->set(impl, entry);
     105                delete existingEntry;
    104106            }
    105107            ++staticFunction;
Note: See TracChangeset for help on using the changeset viewer.