RFR: 8370637: [Windows] Crash if use Graphics after PrintJob.end [v6]
Phil Race
prr at openjdk.org
Wed Nov 5 18:18:27 UTC 2025
> 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 incrementally with one additional commit since the last revision:
8370637
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27984/files
- new: https://git.openjdk.org/jdk/pull/27984/files/dbd0a850..34a4cf49
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27984&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27984&range=04-05
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/27984.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27984/head:pull/27984
PR: https://git.openjdk.org/jdk/pull/27984
More information about the client-libs-dev
mailing list