CursorClose() private method

private CursorClose ( IntPtr handle ) : int
handle System.IntPtr
return int
示例#1
0
        /// <summary>
        /// Closes the Cursor
        /// </summary>
        /// <remarks>
        /// This method wraps the native ups_cursor_close function.
        /// <br />
        /// Closes this Cursor and frees allocated memory. All Cursors should
        /// be closed before closing the Database.
        /// </remarks>
        public void Close()
        {
            if (handle == IntPtr.Zero)
            {
                return;
            }
            int st;

            lock (db) {
                st = NativeMethods.CursorClose(handle);
            }
            if (st != 0)
            {
                throw new DatabaseException(st);
            }
            handle = IntPtr.Zero;
            db     = null;
        }