On Tue, Jan 17, 2012 at 11:51 AM, Bill McCormick <wpmccorm...@gmail.com>wrote:
> What happens if my application fails to call sqlite3_close() before it > exits? Does it leave the db in some unknown state or open to corruption?
> If I have a daemon type program, will I need to catch signals that try to > close/kill the program and call sqlite3_close() before exiting?
Failure to call sqlite3_close() results in memory and file-descriptor leaks if your process keeps running. But as those resources are cleaned up automatically when the process exits, failure to call sqlite3_close() prior to exit is harmless.
If you are using WAL mode, failure to call sqlite3_close() might leave -wal and -shm lingering on your disk. But the next process to open the database file will clean them up automatically, so no harm done.