Closing database in exit handler
Stefan Bellon <[email protected]> Sun, 11 Sep 2005 09:36:58 +0200
| Newsgroups | gmane.mail.bogofilter.devel |
|---|---|
| Message-ID | <[email protected]> |
On RISC OS, file handles are not automatically closed by the operating system when a process dies (yes, this is annoying but cannot be changed). So, if a process crashes and had file handles open at that time, they remain open and the user has to close them manually. When Bogofilter crashes (rarely the case, but happens from time to time), it leaves wordlist.db open. I have no idea where in the code the exact places are, but those in the know, couldn't they just add something like open_database(); atexit(close_database); i.e. register an exit handler when the database got opened? For all but the hardest kind of crashes, this helps on RISC OS. -- Stefan Bellon _______________________________________________ Bogofilter-dev mailing list [email protected] http://www.bogofilter.org/mailman/listinfo/bogofilter-dev