Closed Bug 302445 Opened 19 years ago Closed 19 years ago

Frame leaks make it impossible to print

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(1 file)

Sometimes, we have bugs that cause frames to leak, such as when the frame tree
is malformed and nsFrame::Destroy() doesn't get rid of the entire subtree. This
is especially likely to happen while printing. Many of these bugs are fixed now
but probably not all.

This normally isn't a showstopper, we just chew up memory. However there is one
case when it's really bad. If the lost frames contain a textbox with an
nsEditor, the nsEditor holds a strong reference to the enclosing view manager.
If the page also includes translucency, the view manager will hold a reference
to an nsBlender. And nsBlender holds a reference to the device context. During
printing on Linux, this is an nsDeviceContextPS. Now, nsDeviceContextPS uses
global variables and as a sanity check, it refuses to print if there's an
existing nsDeviceContextPS alive. So if we already did one print job and it
leaked a textbox frame and hence an nsDeviceContextPS, then we won't be able to
print anymore.
Attached patch fixSplinter Review
This is a workaround fix that reduces the harm. We don't need nsBlender to hold
a strong ref to nsIDeviceContext. nsViewManager doesn't hold a strong ref to
the device context either. So even if the view manager leaks, we can still
destroy the device context and print again.
Attachment #190807 - Flags: superreview?(dbaron)
Attachment #190807 - Flags: review?(dbaron)
Attachment #190807 - Flags: superreview?(dbaron)
Attachment #190807 - Flags: superreview+
Attachment #190807 - Flags: review?(dbaron)
Attachment #190807 - Flags: review+
Comment on attachment 190807 [details] [diff] [review]
fix

serious bug horks Linux printing somewhat randomly
Attachment #190807 - Flags: approval1.8b4?
Attachment #190807 - Flags: approval1.8b4? → approval1.8b4+
checked in. Actually, the trunk blender code doesn't refer to the depth at all
so I just removed mDepth.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: