Skip to content

Commit

Permalink
Properly dispose of FileAccess objects
Browse files Browse the repository at this point in the history
  • Loading branch information
RealPlanet committed Jul 9, 2023
1 parent 7f83f98 commit 18f65ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/qodot/src/core/MapParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public bool Load(string filename)

scope = ParseScope.FILE;

FileAccess file = FileAccess.Open(filename, FileAccess.ModeFlags.Read);
using FileAccess file = FileAccess.Open(filename, FileAccess.ModeFlags.Read);
if (file == null)
{
GD.PrintErr("Error: Failed to open map file (" + filename + ")");
Expand Down
2 changes: 1 addition & 1 deletion addons/qodot/src/import_plugins/QuakeWadImportPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public override Error _Import(

string savePathStr = savePath + "." + _GetSaveExtension();

var file = FileAccess.Open(sourceFile, FileAccess.ModeFlags.Read);
using var file = FileAccess.Open(sourceFile, FileAccess.ModeFlags.Read);
if (file == null)
{
Error err = FileAccess.GetOpenError();
Expand Down

0 comments on commit 18f65ef

Please sign in to comment.