diff --git a/src/gui/widgetEx/recyclerview/linearlayoutmanager.cc b/src/gui/widgetEx/recyclerview/linearlayoutmanager.cc index 461b20c4..8e865d30 100755 --- a/src/gui/widgetEx/recyclerview/linearlayoutmanager.cc +++ b/src/gui/widgetEx/recyclerview/linearlayoutmanager.cc @@ -134,9 +134,7 @@ int LinearLayoutManager::getOrientation()const { } void LinearLayoutManager::setOrientation(int orientation) { - if (orientation != HORIZONTAL && orientation != VERTICAL) { - FATAL("invalid orientation:%d",orientation); - } + FATAL_IF( (orientation != HORIZONTAL)&&(orientation != VERTICAL),"invalid orientation:%d",orientation); assertNotInLayoutOrScroll(""); @@ -1653,13 +1651,10 @@ void LinearLayoutManager::SavedState::writeToParcel(Parcel& dest, int flags) { LinearLayoutManager::AnchorInfo::AnchorInfo() { mOrientationHelper = nullptr; + /*mOrientationHelper is owned/destroied by LinearLayoutManager*/ reset(); } -LinearLayoutManager::AnchorInfo::~AnchorInfo(){ - delete mOrientationHelper; -} - void LinearLayoutManager::AnchorInfo::reset() { mPosition = RecyclerView::NO_POSITION; mCoordinate = INVALID_OFFSET; diff --git a/src/gui/widgetEx/recyclerview/linearlayoutmanager.h b/src/gui/widgetEx/recyclerview/linearlayoutmanager.h index cfeacb50..3508a5c7 100755 --- a/src/gui/widgetEx/recyclerview/linearlayoutmanager.h +++ b/src/gui/widgetEx/recyclerview/linearlayoutmanager.h @@ -224,7 +224,6 @@ protected: bool mValid; protected: AnchorInfo(); - virtual ~AnchorInfo(); void reset(); void assignCoordinateFromPadding(); bool isViewValidAsAnchor(View* child, RecyclerView::State& state);