views:

63

answers:

2

Hello All,

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.

A: 

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.

bbum
it was an over retain.. Took some time to figure out what went wrong. Thanks for your response.
Roshan Amadoru
A: 

Hi: I have the same problem, but I don't noticed where is the problem, could you tell me how to fix it? Thanks for your time...