Skip to content

fix: resolve handle leak in image descriptor handling [IDE-1421]#323

Merged
bastiandoetsch merged 4 commits intomainfrom
fix/IDE-1421_fix-handle-leak
Aug 18, 2025
Merged

fix: resolve handle leak in image descriptor handling [IDE-1421]#323
bastiandoetsch merged 4 commits intomainfrom
fix/IDE-1421_fix-handle-leak

Conversation

@bastiandoetsch
Copy link
Copy Markdown
Contributor

@bastiandoetsch bastiandoetsch commented Aug 14, 2025

Description

  • Replace getImageDescriptorFromImage() with direct workbench registry access
  • Fix handle leak caused by getImageData() creating unreleased GC handles
  • Improve thread safety in TreeLabelProvider with proper synchronization
  • Add tests to verify no handle leaks in BaseTreeNode

The fix eliminates the SWTError: No more handles error by avoiding the creation of GC handles entirely and getting ImageDescriptors directly from Eclipse's workbench registry instead of converting from Images.

Checklist

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

- Replace getImageDescriptorFromImage() with direct workbench registry access
- Fix handle leak caused by getImageData() creating unreleased GC handles
- Add comprehensive tests for TreeLabelProvider image caching and disposal
- Improve thread safety in TreeLabelProvider with proper synchronization
- Add tests to verify no handle leaks in BaseTreeNode

The fix eliminates the SWTError: No more handles error by avoiding the creation
of GC handles entirely and getting ImageDescriptors directly from Eclipse's
workbench registry instead of converting from Images.
@bastiandoetsch bastiandoetsch requested review from a team as code owners August 14, 2025 15:43
@snyk-io
Copy link
Copy Markdown

snyk-io bot commented Aug 14, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

public FileTreeNode(String value) {
super(value);
this.setPath(Paths.get(value));
this.setPath(Paths.get(value)); //NOPMD

Check warning

Code scanning / PMD

Unnecessary PMD suppression comment

Unnecessary PMD suppression comment
@bastiandoetsch bastiandoetsch force-pushed the fix/IDE-1421_fix-handle-leak branch from a4f7f4a to bdef528 Compare August 14, 2025 15:51
Comment thread feature/.project
Comment thread .cursorrules
Copy link
Copy Markdown
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

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

LGTM

@bastiandoetsch bastiandoetsch merged commit 581a76d into main Aug 18, 2025
8 checks passed
@bastiandoetsch bastiandoetsch deleted the fix/IDE-1421_fix-handle-leak branch August 18, 2025 08:12
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.

3 participants