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);
|
var tree = parser.Parse(file);
|
||||||
tree.Compile(this);
|
tree.Compile(this);
|
||||||
ImportResolver.ExitFile(file);
|
ImportResolver.ExitFile(file);
|
||||||
|
file.Dispose();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ namespace arookas
|
||||||
FailedToLoad,
|
FailedToLoad,
|
||||||
}
|
}
|
||||||
|
|
||||||
public class sunScriptFile
|
public class sunScriptFile : IDisposable
|
||||||
{
|
{
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public Stream Stream { get; private set; }
|
public Stream Stream { get; private set; }
|
||||||
|
@ -108,6 +108,11 @@ namespace arookas
|
||||||
Stream = stream;
|
Stream = stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Stream.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
public TextReader GetReader()
|
public TextReader GetReader()
|
||||||
{
|
{
|
||||||
return new StreamReader(Stream);
|
return new StreamReader(Stream);
|
||||||
|
|
Loading…
Add table
Reference in a new issue