From b8de4afe7049a8261843553028d4245e4fabe135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E5=85=8B?= Date: Tue, 19 Mar 2013 15:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E4=B8=AD?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B3=84=E9=9C=B2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _posts/2013/2013-03-11-core-text.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_posts/2013/2013-03-11-core-text.md b/_posts/2013/2013-03-11-core-text.md index ced2901..110d3b2 100644 --- a/_posts/2013/2013-03-11-core-text.md +++ b/_posts/2013/2013-03-11-core-text.md @@ -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 %}