我在开发一个应用程序,其中我发现内存泄漏以下方法如何消除泄漏?我如何解决内存泄漏问题?
- (id)initWithString:(NSString *)str attributes:(NSDictionary *)attributes
{
if ((self = [super init]))
{
_buffer = [str mutableCopy];
_attributes = [NSMutableArray arrayWithObjects:[ZAttributeRun attributeRunWithIndex:0 attributes:attributes], nil];
}
return self;
}
我创始泄漏靠近这条线 “_buffer = [STR mutableCopy];”
在分配堆栈跟踪我发现同时内存分配增加为一个CFString。
谢谢。
请特别注意格式化您的代码。你的一点努力可以帮助我们帮助你。 – 2010-09-17 15:10:47