Skip to content

Dispose bold/italic fonts in FontRegistry upon display disposal#3759

Merged
HeikoKlare merged 2 commits intoeclipse-platform:masterfrom
vi-eclipse:bolditalic-font-dispose-hook
Mar 6, 2026
Merged

Dispose bold/italic fonts in FontRegistry upon display disposal#3759
HeikoKlare merged 2 commits intoeclipse-platform:masterfrom
vi-eclipse:bolditalic-font-dispose-hook

Conversation

@HeikoKlare
Copy link
Contributor

The FontRegistry implementation uses hooks to dispose registered fonts upon disposal of the display they have been created for. This implementation does, however, only cover the base fonts but not the bold/italic versions of them. In case only a bold/italic font of a record is created on a separate display, no dispose hook for that display will be created, such that those fonts will not be disposed when the display becomes disposed. In consequence, fonts for non-disposed devices may be returned by the registry.

This change improves the FontRegistry implementation to create a display dispose hook also upon creation of a bold/italic font.

@HeikoKlare HeikoKlare changed the title Display bold/italic fonts in FontRegistry upon display disposal Dispose bold/italic fonts in FontRegistry upon display disposal Mar 3, 2026
The FontRegistry implementation uses hooks to dispose registered fonts
upon disposal of the display they have been created for. This
implementation does, however, only cover the base fonts but not the
bold/italic versions of them. In case only a bold/italic font of a
record is created on a separate display, no dispose hook for that
display will be created, such that those fonts will not be disposed when
the display becomes disposed. In consequence, fonts for non-disposed
devices may be returned by the registry.

This change improves the FontRegistry implementation to create a display
dispose hook also upon creation of a bold/italic font.
@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.jface/META-INF/MANIFEST.MF
tests/org.eclipse.jface.tests/META-INF/MANIFEST.MF

Warning

🚧 This PR cannot be modified by maintainers because edits are disabled or it is created from an organization repository. To obtain the required changes apply the git patch manually as an additional commit.

Git patch
From 0d5a785b067b612c055bf4917623b747e953c6e1 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Tue, 3 Mar 2026 15:21:36 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/bundles/org.eclipse.jface/META-INF/MANIFEST.MF b/bundles/org.eclipse.jface/META-INF/MANIFEST.MF
index 0a2620fd71..a28edbfee3 100644
--- a/bundles/org.eclipse.jface/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jface/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jface;singleton:=true
-Bundle-Version: 3.39.0.qualifier
+Bundle-Version: 3.39.100.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jface,
diff --git a/tests/org.eclipse.jface.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jface.tests/META-INF/MANIFEST.MF
index 22e2c1d34b..9fff0e1559 100644
--- a/tests/org.eclipse.jface.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.jface.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.jface.tests
-Bundle-Version: 1.5.0.qualifier
+Bundle-Version: 1.5.100.qualifier
 Automatic-Module-Name: org.eclipse.jface.tests
 Bundle-RequiredExecutionEnvironment: JavaSE-21
 Require-Bundle: org.eclipse.jface,
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Test Results

 3 024 files  + 9   3 024 suites  +9   2h 6m 51s ⏱️ + 2m 38s
 8 236 tests + 2   7 988 ✅ + 3  248 💤 ±0  0 ❌  - 1 
23 532 runs  +32  22 737 ✅ +26  795 💤 +7  0 ❌  - 1 

Results for commit d29b58d. ± Comparison against base commit e6d3cbf.

♻️ This comment has been updated with latest results.

Copy link
Member

@BeckerWdf BeckerWdf left a comment

Choose a reason for hiding this comment

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

just read the code - did not test.
But code looks good to me.

@HeikoKlare HeikoKlare force-pushed the bolditalic-font-dispose-hook branch from 6fab0d0 to d29b58d Compare March 5, 2026 17:43
@HeikoKlare HeikoKlare merged commit c5f3a58 into eclipse-platform:master Mar 6, 2026
18 checks passed
@HeikoKlare HeikoKlare deleted the bolditalic-font-dispose-hook branch March 6, 2026 13:37
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.

Non-disposed bold/italic fonts in FontRegistry upon display disposal

3 participants