Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

In ImageGCDrawerWrapper#newImageHandle, we create a new image with existing data to initialize the GC, instead we could use the existing image object and the base handle should be created as it is done in PlainImageDataProvider.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 16, 2025

Test Results

  115 files   -    431    115 suites   - 431   9m 49s ⏱️ - 22m 27s
4 395 tests  -     36  4 372 ✅  -     42  15 💤  -   2  4 ❌ +4  4 🔥 +4 
  279 runs   - 16 485    272 ✅  - 16 365   3 💤  - 124  4 ❌ +4 

For more details on these failures and errors, see this check.

Results for commit 01ddea2. ± Comparison against base commit 508ad4a.

This pull request removes 37 and adds 1 tests. Note that renamed tests count towards both.
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_dollarSign
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_emptyString
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_letterA
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_letters
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16LE_null
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_AsciiLetters
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_Asciiletter
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_LotsOfLetters
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_letter
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_letters
…
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_GC ‑ test_noMemoryLeakAfterDispose

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

I've tested the behavior with the LineNumberRuler and that seems to be work fine with different zooms. But with this change we will see the following warnings when strict checks are enabled, which need to be resolved:

***WARNING: Images with handles created for multiple zooms should not be modified.  It should be created with an ImageGcDrawer (see SWT Snippet 384).

@HeikoKlare
Copy link
Contributor

Is this something we can only do for the Windows implementation or may we adapt all the MacOS and Linux implementations of Image as well?

@ShahzaibIbrahim
Copy link
Contributor Author

***WARNING: Images with handles created for multiple zooms should not be modified. It should be created with an ImageGcDrawer (see SWT Snippet 384).

This error should go away once this PR is merged.

@ShahzaibIbrahim
Copy link
Contributor Author

Is this something we can only do for the Windows implementation or may we adapt all the MacOS and Linux implementations of Image as well?

Yes, it make sense to adapt the MacOS and Linux implementation of Image. But since I can't test the changes, I will wait until @fedejeanne is back and can test those changes with him.

For Windows, In ImageGCDrawerWrapper#newImageHandle, we create a new image with
existing data to initialize the GC, instead we could use the existing
image object and the base handle should be created as it is done in
PlainImageDataProvider.

For GTK and Cocoa, We use init methods to create new handles instead of creating a new Image object.
@ShahzaibIbrahim
Copy link
Contributor Author

Closing this PR as removing temporary images does not reduce resource usage; handles still need to be created and disposed. A larger refactoring would be required to address this properly. More info here: vi-eclipse/Eclipse-Platform#328 (comment)

@ShahzaibIbrahim ShahzaibIbrahim deleted the master-328 branch October 27, 2025 10:25
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.

Use the existing image to initialize the GC in ImageGcDrawerWrapper

2 participants