Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

Images inside an ImageList may become disposed. For that reason, methods like indexOf() or add() check for the images inside the list being disposed to null them. This check is missing in the getHandle() method used when requesting the ImageList handle for a different zoom, which can lead to exceptions because of access to a disposed Image instance.

This change adapts the ImageList implementation to always consider that an image inside the list may have been disposed. The according cleanup logic is factored out from all places.

Fixes #2432

@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2025

Test Results

   546 files  ±0     546 suites  ±0   35m 16s ⏱️ - 1m 12s
 4 426 tests ±0   4 409 ✅ ±0   17 💤 ±0  0 ❌ ±0 
16 750 runs  ±0  16 623 ✅ ±0  127 💤 ±0  0 ❌ ±0 

Results for commit 53ddb4a. ± Comparison against base commit 2143c15.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes makes sense and applies the same pattern with disposal check on all relevant accesses of the image array. As the original issue is hard to reproduce and I couldn't reproduce it, it this change looks like a proper fix for it.
I tested with and without monitor specific scaling and didn't find a regression

…lipse-platform#2432

Images inside an ImageList may become disposed. For that reason, methods
like indexOf() or add() check for the images inside the list being
disposed to null them. This check is missing in the getHandle() method
used when requesting the ImageList handle for a different zoom, which
can lead to exceptions because of access to a disposed Image instance.

This change adapts the ImageList implementation to always consider that
an image inside the list may have been disposed. The according cleanup
logic is factored out from all places.

Fixes eclipse-platform#2432
@HeikoKlare HeikoKlare merged commit 7466be6 into eclipse-platform:master Sep 4, 2025
17 checks passed
@HeikoKlare HeikoKlare deleted the issue-2432 branch September 4, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analyze cause of disposed image during DPI change event UI broken after DPI change event

2 participants