On 06/28/2017 09:07 PM, Simon Slavin wrote:
On 28 Jun 2017, at 10:37am, Domonic Tom <[email protected]> wrote:

After calling sqlite3_close(handle) I try then to use the 'remove' method in 
C++ to delete my .db file.  For some reason it just won't delete.
Are you testing the result returned by sqlite3_close() to see if it’s SQLITE_OK 
?  This doesn’t definitely mean you’re doing nothing wrong, but it helps.

It's hard to show you the whole project because it's large.


I believe this has something to do with sqlite3_close only de-allocating the 
connection to the database.


Would anyone know how to go about making sure that the database file is not 
busy and can be deleted.  Is there a specific function for this.
Purely for testing, call sqlite3_shutdown() before you delete the file.  Does 
it work now ?  Then your call to sqlite3_close() didn’t work properly because 
you still had some open handles to the file.

I don't think that will work.

sqlite3_shutdown() will not close any open file descriptors or free any other leaked resources. It just calls shutdown hooks for things like custom malloc or mutex operations. Leaked resources will stay leaked.

Dan.

_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to