Changeset 54596 in webkit for trunk/JavaScriptCore/wtf/RefPtr.h


Ignore:
Timestamp:
Feb 10, 2010, 3:59:02 AM (15 years ago)
Author:
[email protected]
Message:

Use derefIfNotNull() to work around WINSCW compiler forward declaration bug

Patch by Yongjun Zhang <[email protected]> on 2009-10-06
Reviewed by Simon Hausmann.

The compiler bug is reported at
https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812.

The change should be reverted when the above bug is fixed in WINSCW compiler.

JObjectWrapper::ref() and deref() made public accessible to derefIfNull().

https://bugs.webkit.org/show_bug.cgi?id=28054

  • bridge/jni/jsc/JavaInstanceJSC.h:
  • bridge/jni/v8/JavaInstanceV8.h:
File:
1 edited

Legend:

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

    r54595 r54596  
    2525#include "AlwaysInline.h"
    2626#include "FastAllocBase.h"
     27#include "PassRefPtr.h"
    2728
    2829namespace WTF {
     
    5152        bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
    5253
    53         ~RefPtr() { if (T* ptr = m_ptr) ptr->deref(); }
     54        ~RefPtr() { derefIfNotNull(m_ptr); }
    5455       
    5556        template <typename U> RefPtr(const RefPtr<U>& o) : m_ptr(o.get()) { if (T* ptr = m_ptr) ptr->ref(); }
     
    5758        T* get() const { return m_ptr; }
    5859       
    59         void clear() { if (T* ptr = m_ptr) ptr->deref(); m_ptr = 0; }
     60        void clear() { derefIfNotNull(m_ptr); m_ptr = 0; }
    6061        PassRefPtr<T> release() { PassRefPtr<T> tmp = adoptRef(m_ptr); m_ptr = 0; return tmp; }
    6162
Note: See TracChangeset for help on using the changeset viewer.