Skip to content

Conversation

@arunjose696
Copy link
Contributor

This minor refactoring removes unnecessary calls to GC.dispose(), as disposing an Image automatically disposes its associated GC.

The images affected by this change are the color-rectangle visuals used in the color selector and syntax coloring. I tested the behavior both before and after the change and observed no visual differences.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 22m 10s ⏱️ - 2m 5s
 8 270 tests ±0   8 022 ✅ ±0  248 💤 ±0  0 ❌ ±0 
23 634 runs  ±0  22 843 ✅ ±0  791 💤 ±0  0 ❌ ±0 

Results for commit 3f40c99. ± Comparison against base commit 799f52a.

♻️ This comment has been updated with latest results.

gc.drawRectangle(offset, offset, usableImageSize - offset, usableImageSize - offset);
gc.fillRectangle(offset + 1, offset + 1, usableImageSize - offset - 1,
usableImageSize - offset - 1);
gc.dispose();
Copy link
Contributor

Choose a reason for hiding this comment

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

When will the image of this GC be disposed? It's not that obvious so it might be that this GC lives for a very long time. Couldn't the image creation be changed to an ImageGcDrawer instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replaced with ImageGcDrawer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved it to seperate PR as the commit message does not fit with the change to ImageGcDrawer

@arunjose696 arunjose696 force-pushed the arunjose696/RemoveGCDispose branch 2 times, most recently from d27685a to a40ab81 Compare January 22, 2026 08:36
This minor refactoring eliminates unnecessary calls to GC.dispose() since disposing an Image automatically disposes its associated GC. There is no visual impact from this change.
@arunjose696 arunjose696 force-pushed the arunjose696/RemoveGCDispose branch from a40ab81 to 3f40c99 Compare January 22, 2026 13:32
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.

LGTM, image is disposed right after
The second place was converted to a ImageGcDrawer and into a separate PR

@akoch-yatta akoch-yatta merged commit 63d03fc into eclipse-platform:master Jan 22, 2026
18 checks passed
@akoch-yatta akoch-yatta deleted the arunjose696/RemoveGCDispose branch January 22, 2026 15:11
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.

Remove unnecessary GC.dispose() calls for GCs on Image

3 participants