From b22641b7ab2fb01cbf453e37a2c0bb0b64194d9d Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 16 Jun 2022 15:43:10 -0700 Subject: [PATCH] GsfInfileStdio second pass --- .../External/libgsf/Input/GsfInfileStdio.cs | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/BurnOutSharp/External/libgsf/Input/GsfInfileStdio.cs b/BurnOutSharp/External/libgsf/Input/GsfInfileStdio.cs index 942ef643..048e1cda 100644 --- a/BurnOutSharp/External/libgsf/Input/GsfInfileStdio.cs +++ b/BurnOutSharp/External/libgsf/Input/GsfInfileStdio.cs @@ -35,7 +35,7 @@ namespace LibGSF.Input #endregion - #region Constructor + #region Constructor and Destructor /// /// Private constructor @@ -64,6 +64,16 @@ namespace LibGSF.Input return ifs; } + /// + /// Destructor + /// + ~GsfInfileStdio() + { + Root = null; + Children.Clear(); + Children = null; + } + #endregion #region Functions @@ -73,7 +83,7 @@ namespace LibGSF.Input { GsfInfileStdio dst = new GsfInfileStdio { - Root = this.Root, + Root = Root, }; dst.Children.AddRange(Children); @@ -118,9 +128,11 @@ namespace LibGSF.Input { string path = Path.Combine(Root, name); - GsfInput child = null; - if (Directory.Exists(path) || File.Exists(path)) - child = Create(path, ref err); + GsfInput child; + if (Directory.Exists(path)) + child = GsfInfileStdio.Create(path, ref err); + else + child = GsfInputStdio.Create(path, ref err); return child; }