mirror of
https://gh-proxy.org/https://github.com/klinsmaya/dashjim.github.com.git
synced 2026-11-09 09:56:57 +08:00
修改代码中内存泄露的问题
This commit is contained in:
@@ -201,6 +201,8 @@ callbacks的结构体为CTRunDelegateCallbacks,主要是包含一些回调函
|
||||
CTRunDelegateRef runDelegate = CTRunDelegateCreate(&imageCallbacks, taobaoImageName);
|
||||
NSMutableAttributedString *imageAttributedString = [[NSMutableAttributedString alloc] initWithString:@" "];//空格用于给图片留位置
|
||||
[imageAttributedString addAttribute:(NSString *)kCTRunDelegateAttributeName value:(id)runDelegate range:NSMakeRange(0, 1)];
|
||||
CFRelease(runDelegate);
|
||||
|
||||
[imageAttributedString addAttribute:@"imageName" value:taobaoImageName range:NSMakeRange(0, 1)];
|
||||
|
||||
[attributedString insertAttributedString:imageAttributedString atIndex:1];
|
||||
@@ -251,6 +253,10 @@ callbacks的结构体为CTRunDelegateCallbacks,主要是包含一些回调函
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(ctFrame);
|
||||
CFRelease(path);
|
||||
CFRelease(ctFramesetter);
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user