Loading include/utils/RefBase.h +5 −2 Original line number Diff line number Diff line Loading @@ -425,8 +425,11 @@ void wp<T>::set_object_and_refs(T* other, weakref_type* refs) template<typename T> sp<T> wp<T>::promote() const { T* p = (m_ptr && m_refs->attemptIncStrong(this)) ? m_ptr : 0; return sp<T>(p, true); sp<T> result; if (m_ptr && m_refs->attemptIncStrong(&result)) { result.set_pointer(m_ptr); } return result; } template<typename T> Loading include/utils/StrongPointer.h +5 −9 Original line number Diff line number Diff line Loading @@ -104,10 +104,7 @@ public: private: template<typename Y> friend class sp; template<typename Y> friend class wp; // Optimization for wp::promote(). sp(T* p, bool); void set_pointer(T* ptr); T* m_ptr; }; Loading Loading @@ -206,9 +203,8 @@ void sp<T>::clear() } template<typename T> sp<T>::sp(T* p, bool) : m_ptr(p) { void sp<T>::set_pointer(T* ptr) { m_ptr = ptr; } template <typename T> Loading Loading
include/utils/RefBase.h +5 −2 Original line number Diff line number Diff line Loading @@ -425,8 +425,11 @@ void wp<T>::set_object_and_refs(T* other, weakref_type* refs) template<typename T> sp<T> wp<T>::promote() const { T* p = (m_ptr && m_refs->attemptIncStrong(this)) ? m_ptr : 0; return sp<T>(p, true); sp<T> result; if (m_ptr && m_refs->attemptIncStrong(&result)) { result.set_pointer(m_ptr); } return result; } template<typename T> Loading
include/utils/StrongPointer.h +5 −9 Original line number Diff line number Diff line Loading @@ -104,10 +104,7 @@ public: private: template<typename Y> friend class sp; template<typename Y> friend class wp; // Optimization for wp::promote(). sp(T* p, bool); void set_pointer(T* ptr); T* m_ptr; }; Loading Loading @@ -206,9 +203,8 @@ void sp<T>::clear() } template<typename T> sp<T>::sp(T* p, bool) : m_ptr(p) { void sp<T>::set_pointer(T* ptr) { m_ptr = ptr; } template <typename T> Loading