The code in function from the 1st e-mail is used before exiting, so the
sqlite3_close is called in fact.


2013/12/30 Dan Kennedy <danielk1...@gmail.com>

> On 12/29/2013 11:43 PM, Alexander Syvak wrote:
>
>> Hello,
>>
>> there's a LabView app. which is calling C++ function from a DLL.
>> In the DLL the function opens a connection, selects data using
>> sqlite3_exec and closing using the code
>>
>>        int rc = 0;
>>        while ( (rc = sqlite3_close(db)) == SQLITE_BUSY)
>>        {
>>            // TODO:
>>            // shouldn't happen in a good written application but let's
>> handle it
>>            sqlite3_stmt * stmt_raw_p = nullptr;
>>            while ((stmt_raw_p = sqlite3_next_stmt(db, NULL)) != NULL)
>> sqlite3_finalize(stmt_raw_p);
>>           // TODO: if (rc != SQLITE_OK)
>>           // then the app. messes with other thread which should not
>> happen
>>           // more tests are required
>>        }
>> The rc after the if statement holds SQLITE_OK.
>> However, after execution the function the LabView app. is finished but
>> the IDE is not closed. At deleting the db file using Delete key Windows
>> says it's locked and you can either Try again or Cancel. After the IDE is
>> closed, the file may be deleted.
>> It's needed to delete the file during the app. is running.
>>
>
> I would guess you need to call sqlite3_close() before the
> program exits in this case.
>
> Technically, this is the wrong mailing list for questions
> to do with developing SQLite apps. You will get more answers
> on the "sqlite-users" group.
>
> Dan.
>
>
>
>
>>
>> _______________________________________________
>> sqlite-dev mailing list
>> sqlite-...@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev
>>
>
> _______________________________________________
> sqlite-dev mailing list
> sqlite-...@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to