开发者

Why is this line causing leaks?

开发者 https://www.devze.com 2023-03-25 12:23 出处:网络
The following is causing leaks (identified via the Leaks instrume开发者_JAVA技巧nt): field = (char *) sqlite3_column_text(statement, 2);

The following is causing leaks (identified via the Leaks instrume开发者_JAVA技巧nt):

field = (char *) sqlite3_column_text(statement, 2); 
NSString *column3 = [[[NSString alloc] initWithUTF8String:field]]; (this line here) 
rowDefinitionA = column3;
[column3 release];

Is there anything wrong with that line specifically?


You're actually over-releasing column3. Either lose the autorelease or [column3 release].

0

精彩评论

暂无评论...
验证码 换一张
取 消