Closed Bug 295236 Opened 20 years ago Closed 20 years ago

Leak in TableBackgroundPainter::PaintTable

Categories

(Core :: Layout: Tables, defect)

x86
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: ferdinandw+bmo, Assigned: bzbarsky)

References

()

Details

(Keywords: memory-leak)

Attachments

(1 file, 1 obsolete file)

Found through valgrind: cgData isn't always deleted. ==8894== 3552 bytes in 111 blocks are definitely lost in loss record 292 of 323 ==8894== at 0x1B905430: operator new(unsigned) (vg_replace_malloc.c:132) ==8894== by 0x1DB0E414: TableBackgroundPainter::PaintTable(nsTableFrame*, nsMargin*) (nsTablePainter.cpp:395) ==8894== by 0x1DAF0B1E: nsTableFrame::Paint(nsPresContext*, nsIRenderingContext&, nsRect const&, nsFramePaintLayer, unsigned) (nsTableFrame.cpp:1390) ==8894== by 0x1D97826F: nsContainerFrame::PaintChild(nsPresContext*, nsIRenderingContext&, nsRect const&, nsIFrame*, nsFramePaintLayer, unsigned) (nsContainerFrame.cpp:282) ==8894== by 0x1DAFD5AC: nsTableOuterFrame::Paint(nsPresContext*, nsIRenderingContext&, nsRect const&, nsFramePaintLayer, unsigned) (nsTableOuterFrame.cpp:334) ==8894== by 0x1D97826F: nsContainerFrame::PaintChild(nsPresContext*, nsIRenderingContext&, nsRect const&, nsIFrame*, nsFramePaintLayer, unsigned) (nsContainerFrame.cpp:282) ==8894== by 0x1D957B54: nsBlockFrame::PaintChild(nsPresContext*, nsIRenderingContext&, nsRect const&, nsIFrame*, nsFramePaintLayer, unsigned) (nsBlockFrame.h:286) ==8894== by 0x1D963B97: PaintLine(nsRect const&, nsRect const&, nsLineList_iterator&, int, int&, nsPresContext*, nsIRenderingContext&, nsFramePaintLayer, nsBlockFrame*) (nsBlockFrame.cpp:6244)
Attached patch patch (obsolete) — Splinter Review
Forget that, just noticed this patch isn't right.
fantasai: don't we create cgdata on every paint of a table without clearing the previously created?
Ferdinand, could you give this a spin in valgrind?
Attachment #184321 - Attachment is obsolete: true
Tried it on tweakers.net (which is where it showed up before). There are no leaks in nsTablePainter anymore.
Comment on attachment 184329 [details] [diff] [review] Possibly better patch Comment 3 is not a problem because we never call PaintTable() more than once on an nsTablePainter object.
Attachment #184329 - Flags: review?(bernd_mozilla)
Attachment #184329 - Flags: review?(bernd_mozilla) → review+
Comment on attachment 184329 [details] [diff] [review] Possibly better patch jst, mind doing the sr? dbaron and roc are both away right now....
Attachment #184329 - Flags: superreview?(jst)
Comment on attachment 184329 [details] [diff] [review] Possibly better patch sr=dveditz
Attachment #184329 - Flags: superreview?(jst) → superreview+
Comment on attachment 184329 [details] [diff] [review] Possibly better patch Requesting approval -- this is a pretty simple leak fix.
Attachment #184329 - Flags: approval1.8b2?
Attachment #184329 - Flags: approval1.8b2? → approval1.8b2+
Assignee: nobody → bzbarsky
Target Milestone: --- → mozilla1.8beta2
Fixed.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: