コード例 #1
0
        internal static void CloseConnectionV2(SQLiteConnectionHandle hdl, IntPtr db)
        {
            if ((hdl == null) || (db == IntPtr.Zero))
            {
                return;
            }

            try
            {
                // do nothing.
            }
            finally /* NOTE: Thread.Abort() protection. */
            {
#if PLATFORM_COMPACTFRAMEWORK
                lock (hdl.syncRoot)
#else
                lock (hdl)
#endif
                {
#if !SQLITE_STANDARD
                    SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_close_interop(db);
#else
                    ResetConnection(hdl, db, false);

                    SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_close_v2(db);
#endif
                    if (n != SQLiteErrorCode.Ok)
                    {
                        throw new SQLiteException(n, GetLastError(hdl, db));
                    }
                }
            }
        }