Fixing leaking of GraphioStates in nsRenderingContextMac destructor

This commit is contained in:
jfrancis%netscape.com 1999-01-15 05:14:51 +00:00
parent f6f33a44f1
commit 9de778d6ae

View File

@ -293,7 +293,7 @@ nsRenderingContextMac::~nsRenderingContextMac()
PRInt32 cnt = mGSArray->Count();
for (PRInt32 i = 0; i < cnt; i ++)
{
GraphicState* gs = (GraphicState*)mGSArray->ElementAt(cnt);
GraphicState* gs = (GraphicState*)mGSArray->ElementAt(i);
if (gs)
delete gs;
}
@ -308,7 +308,7 @@ nsRenderingContextMac::~nsRenderingContextMac()
PRInt32 cnt = mGSStack->Count();
for (PRInt32 i = 0; i < cnt; i ++)
{
GraphicState* gs = (GraphicState*)mGSStack->ElementAt(cnt);
GraphicState* gs = (GraphicState*)mGSStack->ElementAt(i);
if (gs)
delete gs;
}