mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-02-22 11:54:31 +01:00
Merge pull request #1179 from s4y/fix-1164
Don't rely on NSCache to retain newly-created lines.
This commit is contained in:
@@ -1138,7 +1138,7 @@ static void grid_free(Grid *grid) {
|
||||
if (!strCache){
|
||||
strCache = characterLines[key] = [[[NSCache alloc] init] autorelease];
|
||||
}
|
||||
CTLineRef line = (CTLineRef)[strCache objectForKey:string];
|
||||
CTLineRef line = (CTLineRef)[[strCache objectForKey:string] retain];
|
||||
if (!line) {
|
||||
NSAttributedString *attrString = [[NSAttributedString alloc]
|
||||
initWithString:string
|
||||
@@ -1150,9 +1150,8 @@ static void grid_free(Grid *grid) {
|
||||
line = CTLineCreateWithAttributedString((CFAttributedStringRef)attrString);
|
||||
[attrString release];
|
||||
[strCache setObject:(id)line forKey:[[string copy] autorelease]];
|
||||
CFRelease(line);
|
||||
}
|
||||
return line;
|
||||
return (CTLineRef)[(id)line autorelease];
|
||||
}
|
||||
|
||||
@end // MMCoreTextView (Private)
|
||||
|
||||
Reference in New Issue
Block a user