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

git-svn-id: svn://10.0.0.236/trunk@61372 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2000-02-20 15:18:04 +00:00
parent a27d8dc9ba
commit a57e32fdc7
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);