Added NS_RELEASE's to fix leaking of nsIImage's. bug=19114; r=karnaze@netscape.com

This commit is contained in:
kmcclusk%netscape.com 1999-12-03 00:06:32 +00:00
Родитель c4c76975f6
Коммит 4df6cffe8e
7 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -2184,7 +2184,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
// Restore clipping
aRenderingContext.PopState(clipState);
NS_IF_RELEASE(image);
} else {
// See if there's a background color specified. The background color
// is rendered over the 'border' 'padding' and 'content' areas
@ -2214,6 +2214,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
aRenderingContext.FillRect(aBorderArea);
}
}
}
/** ---------------------------------------------------

Просмотреть файл

@ -36,6 +36,7 @@
#include "nsIURL.h"
#include "nsLayoutAtoms.h"
#include "prprf.h"
#include "nsIImage.h"
nsBulletFrame::nsBulletFrame()
{
@ -134,6 +135,7 @@ nsBulletFrame::Paint(nsIPresContext* aCX,
aRenderingContext.DrawImage(image, innerArea);
return NS_OK;
}
NS_RELEASE(image);
}
}

Просмотреть файл

@ -537,6 +537,8 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
#endif
}
NS_IF_RELEASE(image);
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
PRBool clipState;
aRenderingContext.PopState(clipState);

Просмотреть файл

@ -36,6 +36,7 @@
#include "nsIURL.h"
#include "nsLayoutAtoms.h"
#include "prprf.h"
#include "nsIImage.h"
nsBulletFrame::nsBulletFrame()
{
@ -134,6 +135,7 @@ nsBulletFrame::Paint(nsIPresContext* aCX,
aRenderingContext.DrawImage(image, innerArea);
return NS_OK;
}
NS_RELEASE(image);
}
}

Просмотреть файл

@ -537,6 +537,8 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
#endif
}
NS_IF_RELEASE(image);
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
PRBool clipState;
aRenderingContext.PopState(clipState);

Просмотреть файл

@ -2184,7 +2184,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
// Restore clipping
aRenderingContext.PopState(clipState);
NS_IF_RELEASE(image);
} else {
// See if there's a background color specified. The background color
// is rendered over the 'border' 'padding' and 'content' areas
@ -2214,6 +2214,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
aRenderingContext.FillRect(aBorderArea);
}
}
}
/** ---------------------------------------------------

Просмотреть файл

@ -910,6 +910,8 @@ nsTitledButtonFrame::PaintImage(nsIPresContext* aPresContext,
aRenderingContext.DrawImage(image, mImageRect);
}
NS_IF_RELEASE(image);
return NS_OK;
}