开发者

sqlite memory leak

开发者 https://www.devze.com 2022-12-18 08:23 出处:网络
I\'m struggling with a memory leak of sqlite3. I have the following line in my code score.division = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStmt, 9)];

I'm struggling with a memory leak of sqlite3. I have the following line in my code

score.division = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStmt, 9)];

and it works fine. But when i look at memory leak instrument, i noticed a memory leak so after struggling a bit, i noticed if this statement is not 开发者_运维百科there that memory leak is gone. But I can't possibly think of a reason why this cause a leak. Can someone please help ?

Thanks.


First, why are you bothering with SQLite directly and not simply using Core Data?

In any case, you would to post the backtrace of the actual leak to see whether it is the sqlite3_...() call or the NSString instance itself that is leaking.

If it is the former, it might be a false positive. Latter? it is most likely an over-retain somewhere else.

0

精彩评论

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