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

Rajat Mahajan rmahajan at openjdk.org
Mon Jan 6 21:14:50 UTC 2025


> **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.

Rajat Mahajan has updated the pull request incrementally with one additional commit since the last revision:

  fix indentation and make sure we delete both handles.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22932/files
  - new: https://git.openjdk.org/jdk/pull/22932/files/726fbd9a..bdba3a94

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22932&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22932&range=00-01

  Stats: 9 lines in 1 file changed: 3 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/22932.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22932/head:pull/22932

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


More information about the client-libs-dev mailing list