mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
Fix leak in table background painting. Bug 295236, r=bernd, sr=dveditz, a=asa
This commit is contained in:
parent
c61f3f6d37
commit
2f16a8de39
@ -406,6 +406,9 @@ TableBackgroundPainter::PaintTable(nsTableFrame* aTableFrame,
|
||||
}
|
||||
}
|
||||
|
||||
// Boolean that indicates whether mCols took ownership of cgData
|
||||
PRBool cgDataOwnershipTaken = PR_FALSE;
|
||||
|
||||
/*Loop over columns in this colgroup*/
|
||||
if (cgData->IsVisible()) {
|
||||
for (nsTableColFrame* col = cgFrame->GetFirstColumn(); col;
|
||||
@ -420,6 +423,7 @@ TableBackgroundPainter::PaintTable(nsTableFrame* aTableFrame,
|
||||
mCols[colIndex].mCol.mRect.MoveBy(cgData->mRect.x, cgData->mRect.y);
|
||||
//link to parent colgroup's data
|
||||
mCols[colIndex].mColGroup = cgData;
|
||||
cgDataOwnershipTaken = PR_TRUE;
|
||||
if (mIsBorderCollapse) {
|
||||
border.left = lastLeftBorder;
|
||||
lastLeftBorder = col->GetContinuousBCBorderWidth(mP2t, border);
|
||||
@ -430,6 +434,11 @@ TableBackgroundPainter::PaintTable(nsTableFrame* aTableFrame,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!cgDataOwnershipTaken) {
|
||||
cgData->Destroy(mPresContext);
|
||||
delete cgData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user