Added test code to check for file descriptor leaks.  All regression tests pass
now on both win2k and linux. (CVS 868)

FossilOrigin-Name: 75ba78280f7ab6b6acce5878859312f3223ee898
diff --git a/src/main.c b/src/main.c
index c17c2f1..8fa81d8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.113 2003/02/12 14:09:44 drh Exp $
+** $Id: main.c,v 1.114 2003/02/16 22:21:32 drh Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -457,7 +457,11 @@
 */
 void sqlite_close(sqlite *db){
   HashElem *i;
-  if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ return; }
+  db->want_to_close = 1;
+  if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){
+    /* printf("DID NOT CLOSE\n"); fflush(stdout); */
+    return;
+  }
   db->magic = SQLITE_MAGIC_CLOSED;
   sqliteBtreeClose(db->pBe);
   sqliteResetInternalSchema(db);