Note that there are some explanatory texts on larger screens.

plurals
  1. POInstruments says there is a memory leak in this method, but I can't figure out where
    text
    copied!<p>According to instrument there is memory leak at these lines</p> <pre><code> cat.catName = (catName)?[NSString stringWithUTF8String:catName]:@""; NSData *dataForCachedImage = [[NSData alloc] initWithBytes:sqlite3_column_blob(statement, 2) length: sqlite3_column_bytes(statement, 2)]; cat.catThumb = [UIImage imageWithData:dataForCachedImage]; [dataForCachedImage release]; </code></pre> <p>in the following code.</p> <p>I have also statically analyzed the code.. shows no issue in this file.</p> <pre><code>-(NSMutableArray *)getAllItems{ NSMutableArray *items = [[[NSMutableArray alloc] init] autorelease]; const char *sql = "SELECT * FROM category ORDER by sort"; sqlite3_stmt *statement; int sqlresult = sqlite3_prepare(database, sql, -1, &amp;statement, nil); if (sqlresult == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { Category *cat = [[Category alloc] init]; char *catName = (char *)sqlite3_column_text(statement, 1); cat.catID = sqlite3_column_int(statement, 0); cat.catName = (catName)?[NSString stringWithUTF8String:catName]:@""; NSData *dataForCachedImage = [[NSData alloc] initWithBytes:sqlite3_column_blob(statement, 2) length: sqlite3_column_bytes(statement, 2)]; cat.catThumb = [UIImage imageWithData:dataForCachedImage]; [dataForCachedImage release]; cat.catLock = sqlite3_column_int(statement, 3); cat.sort = sqlite3_column_int(statement, 4); cat.total = [self totalSMS:cat.catID]; [items addObject:cat]; [cat release]; } sqlite3_finalize(statement); } else { NSLog(@"problem with the database"); NSLog(@"%d",sqlresult); } return items;} </code></pre> <p>can someone point out? Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload