diff --git a/SharpPhysFS/PhysFS.cs b/SharpPhysFS/PhysFS.cs index 145b1c5..48f0f3a 100644 --- a/SharpPhysFS/PhysFS.cs +++ b/SharpPhysFS/PhysFS.cs @@ -293,15 +293,13 @@ namespace PhysFS public static IEnumerable SupportedArchiveTypes() { IntPtr archives = Interop.PHYSFS_supportedArchiveTypes(); - IntPtr i; - for (i = archives; Marshal.ReadIntPtr(i) != IntPtr.Zero; i = IntPtr.Add(i, 1)) + IntPtr i = archives; + for (i = archives; Marshal.ReadIntPtr(i) != IntPtr.Zero; i = IntPtr.Add(i, IntPtr.Size)) { IntPtr ptr = Marshal.ReadIntPtr(i); - var info = new ArchiveInfo(); - info = FromPtr(ptr); + var info = FromPtr(ptr); yield return info; } - Interop.PHYSFS_freeList(archives); } ///