소스 검색

Remove statement finalization from SQLite3.close, on MacOSX we get segfaults finalizing statements here.

mingodad 12 년 전
부모
커밋
8c13f4e90f
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      SquiLu-ext/sq_sqlite3.cpp

+ 3 - 2
SquiLu-ext/sq_sqlite3.cpp

@@ -1242,7 +1242,9 @@ static SQRESULT sq_sqlite3_close_release(HSQUIRRELVM v, sq_sqlite3_sdb *sdb)
         int count = 0;
         int count = 0;
         while ((statement = sqlite3_next_stmt(db, statement)))
         while ((statement = sqlite3_next_stmt(db, statement)))
         {
         {
-            sqlite3_finalize(statement);
+        	//do no close statements because garbage collector will do it
+        	//on MacOSX we get segfaults finalizing statements here
+            //sqlite3_finalize(statement);
             count++;
             count++;
         }
         }
         if (count) return sq_throwerror(v, _SC("closing database with %d statements not closed."), count);
         if (count) return sq_throwerror(v, _SC("closing database with %d statements not closed."), count);
@@ -1323,7 +1325,6 @@ static SQRESULT sq_sqlite3_constructor(HSQUIRRELVM v)
     sq_pushuserpointer(v, sdb->db);
     sq_pushuserpointer(v, sdb->db);
     sq_weakref(v, 1);
     sq_weakref(v, 1);
     sq_setonregistrytable(v);
     sq_setonregistrytable(v);
-
     return 1;
     return 1;
 }
 }