On Tue, 4 Aug 2026 14:55:40 GMT, Matthias Baesken <[email protected]> wrote:

> > Fine with me! I created https://bugs.openjdk.org/browse/JDK-8389674 for 
> > this.
> 
> Hi @prrace , while working on JDK-8389674 I noticed another related thing. 
> While the NULL check is present as it should be at some code locations, we 
> call GlobalUnlock always, even if NULL was returned by GlobalLock. Should we 
> change this and move the GlobalUnlock calls inside the if checks? From what I 
> found we will most likely not crash with the current code but it still seems 
> to be not recommended.
> 
> https://github.com/openjdk/jdk/blob/87af1ead7d1d08fa02f2e90251e5254f384d2b67/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp#L688-L700

Yes, we should.

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

PR Comment: https://git.openjdk.org/jdk/pull/32151#issuecomment-5195568515

Reply via email to