Commit 4a9b6cf
committed
Properly dispose font in FontRegistry upon display disposal
When retrieving a font from a FontRegistry instance that is not cached
in the registry yet, it will be created on the current display. In order
to dispose the fonts of a display upon the display's disposal, the
FontRegistry registers a dispose hook at the display instance. The
current implementation only does this for the first display that is
instantiated. For every further display, which may be created on Windows
systems, no hook is added. Thus, if an additional display is disposed,
its fonts remain in the FontRegistry, referring to a disposed display.
This change improved the FontRegistry implementation to properly
register a dispose hook to every display for which it contains fonts. It
also adds an according regression test.1 parent f0e5533 commit 4a9b6cf
File tree
2 files changed
+61
-4
lines changed- bundles/org.eclipse.jface/src/org/eclipse/jface/resource
- tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/resources
2 files changed
+61
-4
lines changedLines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
495 | | - | |
| 496 | + | |
496 | 497 | | |
497 | 498 | | |
498 | 499 | | |
| |||
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
721 | | - | |
| 722 | + | |
722 | 723 | | |
723 | 724 | | |
724 | 725 | | |
| |||
736 | 737 | | |
737 | 738 | | |
738 | 739 | | |
739 | | - | |
| 740 | + | |
740 | 741 | | |
741 | 742 | | |
742 | 743 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
| 30 | + | |
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
| |||
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
44 | 100 | | |
0 commit comments