File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1138,7 +1138,7 @@ - (CTLineRef)lineForCharacterString:(NSString *)string
11381138 if (!strCache){
11391139 strCache = characterLines[key] = [[[NSCache alloc ] init ] autorelease ];
11401140 }
1141- CTLineRef line = (CTLineRef)[strCache objectForKey: string];
1141+ CTLineRef line = (CTLineRef)[[ strCache objectForKey: string] retain ];
11421142 if (!line) {
11431143 NSAttributedString *attrString = [[NSAttributedString alloc ]
11441144 initWithString: string
@@ -1150,9 +1150,8 @@ - (CTLineRef)lineForCharacterString:(NSString *)string
11501150 line = CTLineCreateWithAttributedString ((CFAttributedStringRef)attrString);
11511151 [attrString release ];
11521152 [strCache setObject: (id )line forKey: [[string copy ] autorelease ]];
1153- CFRelease (line);
11541153 }
1155- return line;
1154+ return (CTLineRef)[( id ) line autorelease ] ;
11561155}
11571156
11581157@end // MMCoreTextView (Private)
You can’t perform that action at this time.
0 commit comments