fixed resource leak.

git-svn-id: svn://10.0.0.236/trunk@15390 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
michaelp%netscape.com
1998-11-28 04:24:15 +00:00
parent 84bebdcae2
commit 19eb838ffd
2 changed files with 10 additions and 1 deletions

View File

@@ -30,7 +30,11 @@ nsRegionWin :: nsRegionWin()
nsRegionWin :: ~nsRegionWin()
{
mRegion = NULL;
if (NULL != mRegion)
{
::DeleteObject(mRegion);
mRegion = NULL;
}
}
NS_IMPL_QUERY_INTERFACE(nsRegionWin, kRegionIID)

View File

@@ -38,6 +38,11 @@ nsScrollbar::nsScrollbar(PRBool aIsVertical) : nsWindow(), nsIScrollbar()
mScaleFactor = 1.0f;
mLineIncrement = 0;
mBackground = ::GetSysColor(COLOR_SCROLLBAR);
//prevent resource leaks..
if (mBrush)
::DeleteObject(mBrush);
mBrush = ::CreateSolidBrush(NSRGB_2_COLOREF(mBackground));
}