Closed Bug 101514 Opened 24 years ago Closed 24 years ago

[FIX]crash when cancelling out of Print dialog

Categories

(Core :: Printing: Output, defect, P1)

x86
Windows 2000
defect

Tracking

()

VERIFIED DUPLICATE of bug 101221
mozilla0.9.5

People

(Reporter: rods, Assigned: rods)

References

Details

(Keywords: crash, regression, Whiteboard: Fix in hand)

Status: NEW → ASSIGNED
Keywords: crash, regression
Priority: -- → P1
Target Milestone: --- → mozilla0.9.5
I can't figure out when this started or why it started.
It start with mkaply's check in 1.148 of the nsDocumentViewer.cpp for Roland.Mainz@informatik.med.uni-giessen.de. The problem is these lines: factory->CreateDeviceContextSpec(mWindow, devspec, aSilent); if (nsnull != devspec) { got changed to: rv = factory->CreateDeviceContextSpec(mWindow, devspec, aSilent); if (NS_SUCCEEDED(rv)) { And on Window the CreateDeviceContextSpec call is not passing back error codes. THIS SHOULD HAVE BEEN TESTED ON Windows before being checked in, Don should have done that before giving it an r= The solution is for the factory to pass back the correct error codes which will also help with Bug 101289. Here is the patch: Index: nsDeviceContextSpecFactoryW.cpp =================================================================== RCS file: /cvsroot/mozilla/gfx/src/windows/nsDeviceContextSpecFactoryW.cpp,v retrieving revision 3.20 diff -u -r3.20 nsDeviceContextSpecFactoryW.cpp --- nsDeviceContextSpecFactoryW.cpp 2001/09/18 22:02:30 3.20 +++ nsDeviceContextSpecFactoryW.cpp 2001/09/25 12:24:12 @@ -653,7 +653,11 @@ //don't free the DEVMODE because the device context spec now owns it... ::GlobalUnlock(prntdlg.hDevNames); ::GlobalFree(prntdlg.hDevNames); + } else { + rv = NS_ERROR_FAILURE; } + } else { + rv = NS_ERROR_ABORT; } return rv;
Summary: crash when cancelling out of Print dialog → [FIX]crash when cancelling out of Print dialog
Whiteboard: Fix in hand
Blocks: 101289
> THIS SHOULD HAVE BEEN TESTED ON Windows before being checked in, Don should > have done that before giving it an r= The patch was tested on windows (printing itself works), however noone of us tested the "cancel the print dialog" codepath on windows (I don't have a Win32 build machine myself)... looks I blindly trusted that the tester checked that, too ... _SORRY_ ... ;-(
Uhm... isn't this a DUPLICATE of bug 101221 ("regression: cancelling printing a page crashes - Trunk [@ nsDeviceContextWin::GetDeviceContext") ?
Roland, thanks for the dup, I am behind on looking at the bugs I am copied on. *** This bug has been marked as a duplicate of 101221 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
rods: bug 101221 has already a sr=kin, I only need an r= from you and someone who checks the patch "in", please ...
vrfy dupe
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.