fix ViewInfoStore::removeViewHolder

This commit is contained in:
侯歌 2024-07-06 14:11:55 +08:00
parent a605bbcbbb
commit 5a6d1dda0c

View File

@ -171,9 +171,11 @@ void ViewInfoStore::removeViewHolder(RecyclerView::ViewHolder* holder) {
}
InfoRecord* info = nullptr;//mLayoutHolderMap.remove(holder);
auto it = mLayoutHolderMap.find(holder);
if( it!= mLayoutHolderMap.end() )info = it->second;
if (info != nullptr) {
InfoRecord::recycle(info);
if( it!= mLayoutHolderMap.end() ){
info = it->second;
if(info)
InfoRecord::recycle(info);
mLayoutHolderMap.erase(it);
}
}