diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-28 15:32:59 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-28 15:32:59 (GMT) |
commit | 14aa95bf83e8fa91151b5edd3c346c20d942eb81 (patch) | |
tree | 46ec6389eb1590e0a018c4acbfba670d315987ba /src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h | |
parent | 1c72e77e43593dfea6c6392d1058e63762efb534 (diff) | |
parent | f340825f35ad3de28685f4890cd73bbf9bb6c0e6 (diff) | |
download | Qt-14aa95bf83e8fa91151b5edd3c346c20d942eb81.zip Qt-14aa95bf83e8fa91151b5edd3c346c20d942eb81.tar.gz Qt-14aa95bf83e8fa91151b5edd3c346c20d942eb81.tar.bz2 |
Merge branch 'qtwebkit-4.6-staging' into qtscript-jsc-backend
Conflicts:
src/corelib/tools/qregexp.cpp
src/script/qscriptengine.cpp
src/script/qscriptvalue.cpp
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h b/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h index c174145..761a856 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/RefCounted.h @@ -29,7 +29,7 @@ namespace WTF { // This base class holds the non-template methods and attributes. // The RefCounted class inherits from it reducing the template bloat // generated by the compiler (technique called template hoisting). -class RefCountedBase : Noncopyable { +class RefCountedBase { public: void ref() { @@ -101,7 +101,7 @@ private: }; -template<class T> class RefCounted : public RefCountedBase { +template<class T> class RefCounted : public RefCountedBase, public Noncopyable { public: void deref() { @@ -115,8 +115,23 @@ protected: } }; +template<class T> class RefCountedCustomAllocated : public RefCountedBase, public NoncopyableCustomAllocated { +public: + void deref() + { + if (derefBase()) + delete static_cast<T*>(this); + } + +protected: + ~RefCountedCustomAllocated() + { + } +}; + } // namespace WTF using WTF::RefCounted; +using WTF::RefCountedCustomAllocated; #endif // RefCounted_h |