Loading libutils/include/utils/StrongPointer.h +4 −2 Original line number Original line Diff line number Diff line Loading @@ -228,8 +228,10 @@ void sp<T>::force_set(T* other) { template<typename T> template<typename T> void sp<T>::clear() { void sp<T>::clear() { if (m_ptr) { T* oldPtr(*const_cast<T* volatile*>(&m_ptr)); m_ptr->decStrong(this); if (oldPtr) { oldPtr->decStrong(this); if (oldPtr != *const_cast<T* volatile*>(&m_ptr)) sp_report_race(); m_ptr = nullptr; m_ptr = nullptr; } } } } Loading Loading
libutils/include/utils/StrongPointer.h +4 −2 Original line number Original line Diff line number Diff line Loading @@ -228,8 +228,10 @@ void sp<T>::force_set(T* other) { template<typename T> template<typename T> void sp<T>::clear() { void sp<T>::clear() { if (m_ptr) { T* oldPtr(*const_cast<T* volatile*>(&m_ptr)); m_ptr->decStrong(this); if (oldPtr) { oldPtr->decStrong(this); if (oldPtr != *const_cast<T* volatile*>(&m_ptr)) sp_report_race(); m_ptr = nullptr; m_ptr = nullptr; } } } } Loading