Ignore:
Timestamp:
May 30, 2010, 11:27:35 AM (15 years ago)
Author:
Darin Adler
Message:
  • wtf/OwnArrayPtr.h:

(WTF::OwnArrayPtr::set): Fix the assertion in here to match the one in OwnPtr.
At some point someone fixed the "asserts when assigning to 0 and the pointer is
already 0" issue in OwnPtr but forgot to do it here.

Reviewed by Sam Weinig.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/OwnArrayPtr.h

    r45911 r60417  
    11/*
    2  *  Copyright (C) 2006 Apple Computer, Inc.
     2 *  Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
    33 *
    44 *  This library is free software; you can redistribute it and/or
     
    3636        T* release() { T* ptr = m_ptr; m_ptr = 0; return ptr; }
    3737
    38         void set(T* ptr) { ASSERT(m_ptr != ptr); safeDelete(); m_ptr = ptr; }
     38        // FIXME: This should be renamed to adopt.
     39        void set(T* ptr)
     40        {
     41            ASSERT(!ptr || m_ptr != ptr);
     42            safeDelete();
     43            m_ptr = ptr;
     44        }
     45
    3946        void clear() { safeDelete(); m_ptr = 0; }
    4047
Note: See TracChangeset for help on using the changeset viewer.