sqlite3_finalize not called if executeStep was not looped
Calling
if( query.executeStep() == true )
{
//use only first result
}
Results on WAL mode not working, since the finalizes is not triggered,
changing it to
while ( query.executeStep() == true )
{
//use only first result
}
makes the WAL mode working again.
BUT shall the query.executeStep() not finalize if it goes out of Function Scope
like
{
if( query.executeStep() == true )
{
//use only first result
}
}
//Query has to be finalized
Good catch! Thanks for reporting
Edit: Hmm, in fact the Statement already does finalizing when going out of scope. Not sure anything is missing...
HI,
the problem I saw was if you have the
if( query.executeStep() == true )
{
//use only first result
}
but the SQL query returns multiple rows and you do not loop through them the getColumn() might still have a open references?!? (just an idea)
So if the scope is too large, multiple queries in same scope, I saw this issue.
Using smaller scopes seems to fix it, but maybe the getColumn Pointer copy is the issue? (just thinking about it)