Fixed: dispose the script streams once they exit.
This commit is contained in:
parent
0c973514d9
commit
0b78c1dafe
2 changed files with 7 additions and 1 deletions
|
@ -93,6 +93,7 @@ namespace arookas
|
|||
var tree = parser.Parse(file);
|
||||
tree.Compile(this);
|
||||
ImportResolver.ExitFile(file);
|
||||
file.Dispose();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace arookas
|
|||
FailedToLoad,
|
||||
}
|
||||
|
||||
public class sunScriptFile
|
||||
public class sunScriptFile : IDisposable
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public Stream Stream { get; private set; }
|
||||
|
@ -108,6 +108,11 @@ namespace arookas
|
|||
Stream = stream;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Stream.Dispose();
|
||||
}
|
||||
|
||||
public TextReader GetReader()
|
||||
{
|
||||
return new StreamReader(Stream);
|
||||
|
|
Loading…
Reference in a new issue