On Fri, 24 Oct 2025 22:03:13 GMT, Phil Race <[email protected]> wrote:

> Synchronize WPrinterJob calls which use the printDC to avoid crash in case of 
> mis-use.
> The printerDC is released when the job ends. 
> It is zero-ed out in the handle in which it is stored
> The calls which expect it to be valid now all check for zero and return if it 
> is zero.
> The calls are made synchronized as is the call to endDoc which zeroes it, so 
> that they cannot have it zeroed out whilst using it.
> 
> The tests are the same as in the fix for JDK-8370141 which is also under 
> review.
> Which ever is 2nd to be pushed will have to merge in the changes from the 
> first

This pull request has now been integrated.

Changeset: 7d93cb73
Author:    Phil Race <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/7d93cb73c45d393705504f0637b12512124923a1
Stats:     206 lines in 4 files changed: 126 ins; 0 del; 80 mod

8370637: [Windows] Crash if use Graphics after PrintJob.end

Reviewed-by: azvegint, psadhukhan, aivanov

-------------

PR: https://git.openjdk.org/jdk/pull/27984

Reply via email to