]> jfr.im git - irc/quakenet/newserv.git/blobdiff - sqlite/sqlite.c
merge
[irc/quakenet/newserv.git] / sqlite / sqlite.c
index 746f7848aea4b8d5a7cdf920ed3756487f5bb21e..904ad13d79d05750e54602b39b7a7507a9648456 100644 (file)
@@ -45,8 +45,6 @@ static int inited;
 
 #define SYNC_MODE "OFF"
 
-#define FLAG_DONTFREE 0x02
-
 static void sqlitequeueprocessor(void *arg);
 static void dbstatus(int hooknum, void *arg);
 
@@ -135,7 +133,6 @@ static void processstatement(int rc, sqlite3_stmt *s, SQLiteQueryHandler handler
 
     r = (SQLiteResult *)nsmalloc(POOL_SQLITE, sizeof(SQLiteResult));
     r->r = s;
-    r->flags = 0;
     r->first = 1;
     if(rc == SQLITE_ROW) {
       r->final = 0;
@@ -295,9 +292,6 @@ void sqliteclear(SQLiteResult *r) {
   if(!r)
     return;
 
-  if(r->flags & FLAG_DONTFREE)
-    return;
-
   if(r->r)
     sqlite3_finalize(r->r);
 
@@ -319,28 +313,20 @@ struct sqlitetableloader {
 
 static void loadtablerows(SQLiteConn *c, void *tag) {
   struct sqlitetableloader *t = (struct sqlitetableloader *)tag;
-  SQLiteResult *r = (SQLiteResult *)c;
 
   if(!c) { /* pqsql doesnt call the handlers so we don't either */
     nsfree(POOL_SQLITE, t);
     return;
   }
 
-  r->flags|=FLAG_DONTFREE;
-
   /* the handlers do all the checking and cleanup */
   if(t->init)
-    (t->init)(c, t->tag);
-
-  if(!t->fini)
-    r->flags&=~FLAG_DONTFREE;
+    (t->init)(NULL, t->tag);
 
   (t->data)(c, t->tag);
 
-  r->flags&=~FLAG_DONTFREE;
-
   if(t->fini)
-    (t->fini)(c, t->tag);
+    (t->fini)(NULL, t->tag);
 
   nsfree(POOL_SQLITE, t);
 }