Skip to content

[Win32] Remove unnecessary color disposal in GC#3316

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:win32-gc-remove-color-dispose
May 30, 2026
Merged

[Win32] Remove unnecessary color disposal in GC#3316
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:win32-gc-remove-color-dispose

Conversation

@HeikoKlare
Copy link
Copy Markdown
Contributor

GC operations unnecessarily register stored colors for disposal, though colors do not need to be disposed anymore. This change removes the obsolete disposal tracking.

Contributes to #3296

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Test Results (win32)

   30 files  ±0     30 suites  ±0   4m 39s ⏱️ -25s
4 697 tests ±0  4 622 ✅ ±0  75 💤 ±0  0 ❌ ±0 
1 227 runs  ±0  1 203 ✅ ±0  24 💤 ±0  0 ❌ ±0 

Results for commit 22ddea7. ± Comparison against base commit 1ac0cbf.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

LGTM but just for my understanding: the reason we shouldn't dispose the Colors is because they are either system colors (which should live through the whole applications LC) or they are created outside of our control (in which case the creator should dispose them). Or did I get it wrong?

@iloveeclipse
Copy link
Copy Markdown
Member

we shouldn't dispose the Colors is because they are either system colors (which should live through the whole applications LC) or they are created outside of our control

Colors don't need to be disposed at all anymore (independently of context), they are not system resources anymore after SWT changes.

@fedejeanne
Copy link
Copy Markdown
Member

Indeed, thank you for the pointer!

* Colors do not need to be disposed, however to maintain compatibility
* with older code, disposing a Color is not an error. As Colors do not require
* disposal, the constructors which do not require a Device are recommended.

GC operations unnecessarily register stored colors for disposal, though
colors do not need to be disposed anymore. This change removes the
obsolete disposal tracking.

Contributes to
eclipse-platform#3296
@HeikoKlare HeikoKlare force-pushed the win32-gc-remove-color-dispose branch from 168241f to 22ddea7 Compare May 30, 2026 08:24
@HeikoKlare HeikoKlare merged commit e95edb8 into eclipse-platform:master May 30, 2026
18 checks passed
@HeikoKlare HeikoKlare deleted the win32-gc-remove-color-dispose branch May 30, 2026 09: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.

3 participants