Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Simon Slavin
On 15 May 2012, at 9:03pm, "Jay A. Kreibich" wrote: > That's missing the point. You're never supposed to get there. > Having unaccounted for statements when you close the database is > essentially a memory leak. You've got data structures the > application lost track of and didn't clean up

Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Jay A. Kreibich
On Tue, May 15, 2012 at 08:49:50PM +0100, Simon Slavin scratched on the wall: > > On 15 May 2012, at 8:38pm, Baruch Burstein wrote: > > > I am working on a C++ wrapper for sqlite. It > > is the wrapper's user's responsibility to make sure no statement objects > > still exist before the databas

Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Jay A. Kreibich
On Tue, May 15, 2012 at 10:38:29PM +0300, Baruch Burstein scratched on the wall: > On Tue, May 15, 2012 at 10:34 PM, Jay A. Kreibich wrote: > > > On Tue, May 15, 2012 at 10:17:41PM +0300, Baruch Burstein scratched on > > the wall: > > > Which of the following should I be running right before call

Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Simon Slavin
On 15 May 2012, at 8:38pm, Baruch Burstein wrote: > I am working on a C++ wrapper for sqlite. It > is the wrapper's user's responsibility to make sure no statement objects > still exist before the database object gets destroyed. This is just a > precaution. I am surprised that doing _close()

Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Baruch Burstein
On Tue, May 15, 2012 at 10:34 PM, Jay A. Kreibich wrote: > On Tue, May 15, 2012 at 10:17:41PM +0300, Baruch Burstein scratched on > the wall: > > Which of the following should I be running right before calling > > sqlite3_close? > > > > while(stmt = sqlite3_next_stmt(db, stmt)) > > sqlite

Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Simon Slavin
On 15 May 2012, at 8:17pm, Baruch Burstein wrote: > Which of the following should I be running right before calling > sqlite3_close? > > while(stmt = sqlite3_next_stmt(db, stmt)) >sqlite3_finalize(stmt); You would, of course, have to initialise your value for stmt before entering that

Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Jay A. Kreibich
On Tue, May 15, 2012 at 10:17:41PM +0300, Baruch Burstein scratched on the wall: > Which of the following should I be running right before calling > sqlite3_close? > > while(stmt = sqlite3_next_stmt(db, stmt)) > sqlite3_finalize(stmt); > > while(stmt = sqlite3_next_stmt(db, NULL)) >

[sqlite] finalizing all statements before closing connection

2012-05-15 Thread Baruch Burstein
Which of the following should I be running right before calling sqlite3_close? while(stmt = sqlite3_next_stmt(db, stmt)) sqlite3_finalize(stmt); while(stmt = sqlite3_next_stmt(db, NULL)) sqlite3_finalize(stmt); I am not sure which will have the desired effect. -- Programming tod