Bug 1156108 - Make nsTreeColumns::mFirstColumn an nsRefPtr; r=roc

This commit is contained in:
Ehsan Akhgari 2015-04-19 14:51:40 -04:00
parent 053efd7a2b
commit d871ed2e61
2 changed files with 4 additions and 5 deletions

View File

@ -393,8 +393,7 @@ nsTreeColumn::Invalidate(mozilla::ErrorResult& aRv)
}
nsTreeColumns::nsTreeColumns(nsTreeBodyFrame* aTree)
: mTree(aTree),
mFirstColumn(nullptr)
: mTree(aTree)
{
}
@ -669,7 +668,7 @@ nsTreeColumns::InvalidateColumns()
currCol = currCol->GetNext()) {
currCol->SetColumns(nullptr);
}
NS_IF_RELEASE(mFirstColumn);
mFirstColumn = nullptr;
return NS_OK;
}
@ -759,7 +758,7 @@ nsTreeColumns::EnsureColumns()
col->SetPrevious(currCol);
}
else {
NS_ADDREF(mFirstColumn = col);
mFirstColumn = col;
}
currCol = col;
}

View File

@ -211,7 +211,7 @@ private:
* XXX this means that new nsTreeColumn objects are unnecessarily created
* for untouched columns.
*/
nsTreeColumn* mFirstColumn;
nsRefPtr<nsTreeColumn> mFirstColumn;
};
#endif // nsTreeColumns_h__