新しい結果セットを作成する前に、Titanium Mobile で結果セットを閉じる必要がありますか?それとも、参照がなくなると自動的に「閉じられる」のでしょうか?
たとえば、このようなものは安全でメモリ リークがないのでしょうか?
var db = db.open("db_name");
var rs = db.execute("SELECT * FROM table");
while(rs.isValidRow()){ /* working with the resuls... */ }
// I make another select before closing the previous (current) results set
rs = db.execute("SELECT * FROM another_table");
while(rs.isValidRow()){ /* working with the results... */ }
// Once I am completely done I close the RS and DB
rs.close();
db.close();
または、新しい選択が必要になるたびに結果セットを閉じる必要があります。
var db = db.open("db_name");
var rs = db.execute("SELECT * FROM table");
while(rs.isValidRow()){ /* working with the resuls... */ }
// Close RS and then initialize a new one
rs.close();
rs = db.execute("SELECT * FROM another_table");
while(rs.isValidRow()){ /* working with the resuls... */ }
rs.close();
db.close();