Skip to content

[Win32] Remove unnecessary color disposal in GC#3316

Open
HeikoKlare wants to merge 1 commit into
eclipse-platform:masterfrom
HeikoKlare:win32-gc-remove-color-dispose
Open

[Win32] Remove unnecessary color disposal in GC#3316
HeikoKlare wants to merge 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

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
@github-actions
Copy link
Copy Markdown
Contributor

Test Results (win32)

   30 files  ±0     30 suites  ±0   4m 46s ⏱️ +2s
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 168241f. ± Comparison against base commit 7f9089e.

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.

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