RFR: 8370141: [macOS] Crash after PrinterJob ends when Graphics.create() is used. [v2]

Sergey Bylokhov serb at openjdk.org
Tue Oct 28 03:56:03 UTC 2025


On Fri, 24 Oct 2025 18:35:27 GMT, Phil Race <prr at openjdk.org> wrote:

>> macOS printing uses a Quartz surface. It is the SurfaceData for a CPrinterGraphics.
>> That Surface is not disconnected from the graphics unless Graphics.dispose() is called.
>> If the application uses Graphics.create() then the implementation will not Graphics.dispose() it.
>> If it is used after printing is complete and the CGContext is no longer valid a crash will occur.
>> We need to invalidate the surface as soon as printing to a page is done.
>> Note: this is Graphics.dispose(), and is unrelated to disposal of an object when it becomes unreachable.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8370141

Marked as reviewed by serb (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/27905#pullrequestreview-3386458015


More information about the client-libs-dev mailing list