/// <summary> /// Closes the Environment /// </summary> /// <remarks> /// This method wraps the native ups_env_close function. /// <br /> /// </remarks> public void Close() { if (handle == IntPtr.Zero) { return; } lock (this) { foreach (Database db in databases) { db.Close(); } databases.Clear(); int st = NativeMethods.EnvClose(handle, 0); if (st != 0) { throw new DatabaseException(st); } handle = IntPtr.Zero; } }