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.
------------- Commit messages: - 8370141 - 8370141 Changes: https://git.openjdk.org/jdk/pull/27905/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27905&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370141 Stats: 147 lines in 4 files changed: 141 ins; 5 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27905.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27905/head:pull/27905 PR: https://git.openjdk.org/jdk/pull/27905
