Bug 416510 - "nsSliderFrame should use nsCOMPtr for its mMediator" [p=kayjay@poczta.fm (kayjay) r+sr=roc a1.9=schrep]

This commit is contained in:
reed@reedloden.com 2008-02-13 02:41:23 -08:00
parent e7b97c3e18
commit ca7d34dbff
2 changed files with 2 additions and 5 deletions

View File

@ -95,8 +95,7 @@ nsSliderFrame::nsSliderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
nsBoxFrame(aPresShell, aContext), nsBoxFrame(aPresShell, aContext),
mCurPos(0), mCurPos(0),
mScrollbarListener(nsnull), mScrollbarListener(nsnull),
mChange(0), mChange(0)
mMediator(nsnull)
{ {
} }
@ -955,7 +954,6 @@ nsSliderFrame::AddListener()
{ {
if (!mMediator) { if (!mMediator) {
mMediator = new nsSliderMediator(this); mMediator = new nsSliderMediator(this);
NS_ADDREF(mMediator);
} }
nsIFrame* thumbFrame = mFrames.FirstChild(); nsIFrame* thumbFrame = mFrames.FirstChild();
@ -1027,7 +1025,6 @@ nsSliderFrame::Destroy()
// tell our mediator if we have one we are gone. // tell our mediator if we have one we are gone.
if (mMediator) { if (mMediator) {
mMediator->SetSlider(nsnull); mMediator->SetSlider(nsnull);
NS_RELEASE(mMediator);
mMediator = nsnull; mMediator = nsnull;
} }

View File

@ -242,7 +242,7 @@ private:
nscoord mChange; nscoord mChange;
nsPoint mDestinationPoint; nsPoint mDestinationPoint;
nsSliderMediator* mMediator; nsRefPtr<nsSliderMediator> mMediator;
static PRBool gMiddlePref; static PRBool gMiddlePref;
static PRInt32 gSnapMultiplier; static PRInt32 gSnapMultiplier;