Ignore:
Timestamp:
Feb 16, 2010, 9:57:24 PM (15 years ago)
Author:
[email protected]
Message:

Fix a handful of other leaks seen on the buildbot.

Patch by Gavin Barraclough <[email protected]> on 2010-02-16
Reviewed by Mark Rowe.

  • runtime/UStringImpl.h:

(JSC::UStringOrRopeImpl::deref): Delegate through to the subclass version of deref to ensure that
the correct cleanup takes place. This function previously featured some code that attempted to
skip deletion of static UStringImpl's. Closer inspection revealed that it was in fact equivalent
to "if (false)", meaning that UStringImpl's which had their final deref performed via this function
were leaked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/UStringImpl.h

    r54866 r54870  
    347347inline void UStringOrRopeImpl::deref()
    348348{
    349     m_refCountAndFlags -= s_refCountIncrement;
    350     if (!(m_refCountAndFlags & s_refCountMask)) {
    351         if (isRope())
    352             static_cast<URopeImpl*>(this)->destructNonRecursive();
    353         else if (!s_refCountFlagStatic)
    354             delete static_cast<UStringImpl*>(this);
    355     }
     349    if (isRope())
     350        static_cast<URopeImpl*>(this)->deref();
     351    else
     352        static_cast<UStringImpl*>(this)->deref();
    356353}
    357354
Note: See TracChangeset for help on using the changeset viewer.