summaryrefslogtreecommitdiff
path: root/src/nsfont.m
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2012-10-12 12:01:05 +0200
committerJan Djärv <jan.h.d@swipnet.se>2012-10-12 12:01:05 +0200
commit2b9c2e68501ac897447340bd3f2af8e88f03d767 (patch)
treef181604780b8e9bbba9a5d105359e8c08220d7bd /src/nsfont.m
parent81749a2374c78d656888b462f3b29301e4cbd1c7 (diff)
* nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
Diffstat (limited to 'src/nsfont.m')
-rw-r--r--src/nsfont.m34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/nsfont.m b/src/nsfont.m
index a820b60ac58..7c9f05aa0bb 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -729,16 +729,6 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
NSRect brect;
Lisp_Object font_object;
int fixLeopardBug;
- static NSMutableDictionary *fontCache = nil;
- NSNumber *cached;
-
- /* 2008/03/08: The same font may end up being requested for different
- entities, due to small differences in numeric values or other issues,
- or for different copies of the same entity. Therefore we cache to
- avoid creating multiple struct font objects (with metrics cache, etc.)
- for the same NSFont object. */
- if (fontCache == nil)
- fontCache = [[NSMutableDictionary alloc] init];
if (NSFONT_TRACE)
{
@@ -794,28 +784,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
if (NSFONT_TRACE)
NSLog (@"%@\n", nsfont);
- /* Check the cache */
- cached = [fontCache objectForKey: nsfont];
- if (cached != nil && !synthItal)
- {
- if (NSFONT_TRACE)
- fprintf(stderr, "*** nsfont_open CACHE HIT!\n");
- XHASH (font_object) = [cached unsignedLongLongValue];
- return font_object;
- }
- else
- {
- font_object = font_make_object (VECSIZE (struct nsfont_info),
- font_entity, pixel_size);
- if (!synthItal)
- {
- [fontCache setObject: [NSNumber
- numberWithUnsignedLongLong:
- (unsigned long long) XHASH (font_object)]
- forKey: nsfont];
- }
- }
-
+ font_object = font_make_object (VECSIZE (struct nsfont_info),
+ font_entity, pixel_size);
font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);
font = (struct font *) font_info;
if (!font)