From 18f65ef7ec82d37caccefcc729eaf879fbc58184 Mon Sep 17 00:00:00 2001 From: Fabio Ruscica Date: Sun, 9 Jul 2023 15:32:45 +0200 Subject: [PATCH] Properly dispose of FileAccess objects --- addons/qodot/src/core/MapParser.cs | 2 +- addons/qodot/src/import_plugins/QuakeWadImportPlugin.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/qodot/src/core/MapParser.cs b/addons/qodot/src/core/MapParser.cs index 9d4ad9e..1eb9c31 100644 --- a/addons/qodot/src/core/MapParser.cs +++ b/addons/qodot/src/core/MapParser.cs @@ -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 + ")"); diff --git a/addons/qodot/src/import_plugins/QuakeWadImportPlugin.cs b/addons/qodot/src/import_plugins/QuakeWadImportPlugin.cs index 64f4aaa..b6c2176 100644 --- a/addons/qodot/src/import_plugins/QuakeWadImportPlugin.cs +++ b/addons/qodot/src/import_plugins/QuakeWadImportPlugin.cs @@ -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();