Closed
Bug 375495
Opened 18 years ago
Closed 18 years ago
Crashing while Printing
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: cbarrett, Assigned: cbarrett)
Details
Attachments
(1 file, 1 obsolete file)
|
2.09 KB,
patch
|
pavlov
:
review+
pavlov
:
superreview+
|
Details | Diff | Splinter Review |
In addition to not printing (bug 368933) we are also prone to crashing when we de-reference a null surface. Somehow.
Stuart Parmenter wrote the attached patch on my machine while we were going through trying to debug bug 368933.
Comment on attachment 259767 [details] [diff] [review]
fix v1.0
I'm not sure if we want to do that, requesting review from Pav.
Attachment #259767 -
Flags: superreview?(pavlov)
Comment 2•18 years ago
|
||
Does the crash actually still happen? We shouldn't ever hit that situation and I'd like to know why we do before we bandaid over it. Also don't use tabs in patches.
| Assignee | ||
Comment 3•18 years ago
|
||
Sigh, Xcode's defaults are tabs.
I'm not sure how we're getting into that situation. Could nulling the surface in EndPage (because we need a new surface for each page), cause this sort of thing to happen?
Comment 4•18 years ago
|
||
We shouldn't be using the same rendering context for each page per simplepageiterator code in layout... Can you please debug further?
| Assignee | ||
Comment 5•18 years ago
|
||
Figured it out, here's the patch.
To figure this out I had to understand both the gecko print loop (nsSimplePageSequence::PrintNextPage) and the Carbon one (http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap2/chapter_2_section_6.html). That should be useful in case this ever breaks again somehow.
Re-ordered the calls in nsThebesDeviceContext::BeginPage so that the PrintManager calls get done in the right order (BeginPage, GetCGContext, EndPage). The earlier patch was just kind of masking this.
For future reference, the problem was that we didn't have a valid mPrintingSurface when BeginPage was called by nsSimplePageSequence. CreateRenderingContext had a hack to re-create the QuartzSurface after we null it in EndPage, since each Surface represents one page on the Mac. However, just moving the call to that in nsSimplePageSequence above BeginPage is wrong, because on the Mac (and perhaps elsewhere), we need to call BeginPage before we can get the rendering context.
Pav checked and it didn't seem like reordering those calls would have any effect on Linux or Windows.
Attachment #259767 -
Attachment is obsolete: true
Attachment #259870 -
Flags: review?
Attachment #259767 -
Flags: superreview?(pavlov)
| Assignee | ||
Updated•18 years ago
|
Attachment #259870 -
Flags: review? → review?(pavlov)
Updated•18 years ago
|
Attachment #259870 -
Flags: superreview+
Attachment #259870 -
Flags: review?(pavlov)
Attachment #259870 -
Flags: review+
checked in on trunk
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•