RFR: 8370637: [Windows] Crash if use Graphics after PrintJob.end [v2]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Mon Nov 3 08:50:04 UTC 2025
On Thu, 30 Oct 2025 21:17:50 GMT, Phil Race <prr at openjdk.org> 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
>
> Phil Race has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
>
> - 8370637
> - 8370637
> - Merge
> - 8370637
Marked as reviewed by psadhukhan (Reviewer).
test/jdk/java/awt/PrintJob/PrintJobAfterEndTest.java line 26:
> 24:
> 25: /*
> 26: @test
no * here at all...to be consistent with above test and other, we can add *
test/jdk/java/awt/print/PrinterJob/PrintAfterEndTest.java line 24:
> 22: */
> 23:
> 24: /**
* single asterisk for consistency..
-------------
PR Review: https://git.openjdk.org/jdk/pull/27984#pullrequestreview-3409959096
PR Review Comment: https://git.openjdk.org/jdk/pull/27984#discussion_r2485703913
PR Review Comment: https://git.openjdk.org/jdk/pull/27984#discussion_r2485701930
More information about the client-libs-dev
mailing list