Skip to content

Commit

Permalink
Clean up object
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenretriverYT committed Dec 10, 2023
1 parent 6c641d9 commit fb46536
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion source/Cosmos.System2/FileSystem/FAT/FatStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using System;
using System.IO;

using Cosmos.Core;
using Cosmos.System.FileSystem.FAT.Listing;

namespace Cosmos.System.FileSystem.FAT
Expand Down Expand Up @@ -426,6 +426,8 @@ public override void Write(byte[] aBuffer, int aOffset, int aCount)
aOffset += (int)xWriteSize;
mPosition += xWriteSize;
}

GCImplementation.Free(xCluster);
}
}
}
8 changes: 3 additions & 5 deletions source/Cosmos.System2_Plugs/System/IO/FileImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ public static void WriteAllLines(string path, string[] contents)

public static void WriteAllBytes(string path, byte[] aData)
{
BinaryWriter Writer = new(new FileStream(path, FileMode.OpenOrCreate));

Writer.Write(aData);

Writer.Dispose();
var writer = new FileStream(path, FileMode.OpenOrCreate);
writer.Write(aData);
writer.Dispose();
}
}
}

0 comments on commit fb46536

Please sign in to comment.