File tree 1 file changed +2
-3
lines changed
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
1138
1138
if (!strCache){
1139
1139
strCache = characterLines[key] = [[[NSCache alloc ] init ] autorelease ];
1140
1140
}
1141
- CTLineRef line = (CTLineRef)[strCache objectForKey: string];
1141
+ CTLineRef line = (CTLineRef)[[ strCache objectForKey: string] retain ];
1142
1142
if (!line) {
1143
1143
NSAttributedString *attrString = [[NSAttributedString alloc ]
1144
1144
initWithString: string
@@ -1150,9 +1150,8 @@ - (CTLineRef)lineForCharacterString:(NSString *)string
1150
1150
line = CTLineCreateWithAttributedString ((CFAttributedStringRef )attrString);
1151
1151
[attrString release ];
1152
1152
[strCache setObject: (id )line forKey: [[string copy ] autorelease ]];
1153
- CFRelease (line);
1154
1153
}
1155
- return line;
1154
+ return (CTLineRef)[( id ) line autorelease ] ;
1156
1155
}
1157
1156
1158
1157
@end // MMCoreTextView (Private)
You can’t perform that action at this time.
0 commit comments