RFR: 8282862: AwtWindow::SetIconData leaks old icon handles if an exception is detected [v2]

Harshitha Onkar honkar at openjdk.org
Fri Jan 17 17:56:51 UTC 2025


On Thu, 16 Jan 2025 21:25:25 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> It my be tested by defining [`OUTOFMEM_TEST`](https://github.com/openjdk/jdk/blob/062f2dcfe5b62cc3dd3c292eeebd7a7ac78f849a/src/java.desktop/windows/native/libawt/windows/awt_new.cpp#L174C8-L174C21) in `awt_new.cpp` to enable random allocation failures.
> 
> Another way could be to change the source code to explicitly cause `std::bad_alloc` and/or a Java exception in any of the called methods. Just to validate the suggested fix really works… on top of static code analysis.

@aivanov-jdk Thanks for clarifying.

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

PR Comment: https://git.openjdk.org/jdk/pull/22932#issuecomment-2598884615


More information about the client-libs-dev mailing list