diff --git a/gfx/src/windows/nsRegionWin.cpp b/gfx/src/windows/nsRegionWin.cpp index 075a892cb98e..a9b1de35b32d 100644 --- a/gfx/src/windows/nsRegionWin.cpp +++ b/gfx/src/windows/nsRegionWin.cpp @@ -30,7 +30,11 @@ nsRegionWin :: nsRegionWin() nsRegionWin :: ~nsRegionWin() { - mRegion = NULL; + if (NULL != mRegion) + { + ::DeleteObject(mRegion); + mRegion = NULL; + } } NS_IMPL_QUERY_INTERFACE(nsRegionWin, kRegionIID) diff --git a/widget/src/windows/nsScrollbar.cpp b/widget/src/windows/nsScrollbar.cpp index 1d9ab397f978..6e4d2cdceaf4 100644 --- a/widget/src/windows/nsScrollbar.cpp +++ b/widget/src/windows/nsScrollbar.cpp @@ -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)); }