Integrated: 8282862: AwtWindow::SetIconData leaks old icon handles if an exception is detected

Rajat Mahajan rmahajan at openjdk.org
Thu Jan 23 20:55:51 UTC 2025


On Mon, 6 Jan 2025 17:38:24 GMT, Rajat Mahajan <rmahajan at openjdk.org> wrote:

> **Issue:** 
> AwtWindow::SetIconData leaks the old icon handles in hOldIcon and hOldIconSm if CreateIconFromRaster raises an exception. Additionally, an exception is checked only after the first call to CreateIconFromRaster.
> 
> **Solution:**
> I have added the exception handling code to take care that the handles are properly destroyed and not leaked.
> 
> **Testing:**
> I have tested the code to make sure there are no regressions caused by this.

This pull request has now been integrated.

Changeset: 48ece072
Author:    Rajat Mahajan <rmahajan at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/48ece0721489c1b357aaa81e89fe59f486079d15
Stats:     42 lines in 1 file changed: 35 ins; 3 del; 4 mod

8282862: AwtWindow::SetIconData leaks old icon handles if an exception is detected

Reviewed-by: aivanov, dmarkov, prr, honkar, azvegint

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

PR: https://git.openjdk.org/jdk/pull/22932


More information about the client-libs-dev mailing list