Bug 28555: fix large leak of StyleContextImpl's. r=karnaze@netscape.com a=jar@netscape.com

This commit is contained in:
dbaron%fas.harvard.edu 2000-02-20 15:18:04 +00:00
parent 3c1d11233c
commit 8438b1f02d
4 changed files with 28 additions and 8 deletions

View File

@ -189,10 +189,15 @@ const nsStyleColor* nsStyleUtil::FindNonTransparentBackground(nsIStyleContext* a
PRBool aStartAtParent /*= PR_FALSE*/)
{
const nsStyleColor* result = nsnull;
nsIStyleContext* context = aStartAtParent ? aContext->GetParent() : aContext;
nsIStyleContext* context;
if (aStartAtParent) {
context = aContext->GetParent(); // balance ending release
} else {
context = aContext;
NS_IF_ADDREF(context); // balance ending release
}
NS_ASSERTION( context != nsnull, "Cannot find NonTransparentBackground in a null context" );
NS_IF_ADDREF(context); // balance ending release
while (nsnull != context) {
result = (const nsStyleColor*)context->GetStyleData(eStyleStruct_Color);

View File

@ -189,10 +189,15 @@ const nsStyleColor* nsStyleUtil::FindNonTransparentBackground(nsIStyleContext* a
PRBool aStartAtParent /*= PR_FALSE*/)
{
const nsStyleColor* result = nsnull;
nsIStyleContext* context = aStartAtParent ? aContext->GetParent() : aContext;
nsIStyleContext* context;
if (aStartAtParent) {
context = aContext->GetParent(); // balance ending release
} else {
context = aContext;
NS_IF_ADDREF(context); // balance ending release
}
NS_ASSERTION( context != nsnull, "Cannot find NonTransparentBackground in a null context" );
NS_IF_ADDREF(context); // balance ending release
while (nsnull != context) {
result = (const nsStyleColor*)context->GetStyleData(eStyleStruct_Color);

View File

@ -189,10 +189,15 @@ const nsStyleColor* nsStyleUtil::FindNonTransparentBackground(nsIStyleContext* a
PRBool aStartAtParent /*= PR_FALSE*/)
{
const nsStyleColor* result = nsnull;
nsIStyleContext* context = aStartAtParent ? aContext->GetParent() : aContext;
nsIStyleContext* context;
if (aStartAtParent) {
context = aContext->GetParent(); // balance ending release
} else {
context = aContext;
NS_IF_ADDREF(context); // balance ending release
}
NS_ASSERTION( context != nsnull, "Cannot find NonTransparentBackground in a null context" );
NS_IF_ADDREF(context); // balance ending release
while (nsnull != context) {
result = (const nsStyleColor*)context->GetStyleData(eStyleStruct_Color);

View File

@ -189,10 +189,15 @@ const nsStyleColor* nsStyleUtil::FindNonTransparentBackground(nsIStyleContext* a
PRBool aStartAtParent /*= PR_FALSE*/)
{
const nsStyleColor* result = nsnull;
nsIStyleContext* context = aStartAtParent ? aContext->GetParent() : aContext;
nsIStyleContext* context;
if (aStartAtParent) {
context = aContext->GetParent(); // balance ending release
} else {
context = aContext;
NS_IF_ADDREF(context); // balance ending release
}
NS_ASSERTION( context != nsnull, "Cannot find NonTransparentBackground in a null context" );
NS_IF_ADDREF(context); // balance ending release
while (nsnull != context) {
result = (const nsStyleColor*)context->GetStyleData(eStyleStruct_Color);