RFR: JDK-8313252: Java_sun_awt_windows_ThemeReader_paintBackground release resources in early returns

Christoph Langer clanger at openjdk.org
Mon Jul 31 07:24:45 UTC 2023


On Fri, 28 Jul 2023 07:52:14 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> In file ThemeReader.cpp functionJava_sun_awt_windows_ThemeReader_paintBackground
> we create DCs and release them at the end, but seems we miss it in early returns.
> 
> While looking at the code, I noticed that CreateCompatibleDC can return NULL in case of error/failure, but we ignore this case; see 
> https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createcompatibledc   .
> Should we better handle it or is it not really occurring in practise ?

Marked as reviewed by clanger (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/15064#pullrequestreview-1554108843



More information about the client-libs-dev mailing list