It would perhaps be perspicacious to close (as in sqlite3_close) the database before deleting it. Just sayin.