close sys.io.Process stuff when we're done with them

This commit is contained in:
Cameron Taylor 2024-09-18 16:15:10 -04:00
parent 215e20cabe
commit 472d41a893
2 changed files with 10 additions and 0 deletions

View file

@ -941,6 +941,8 @@ class Project extends HXProject {
var commitHash:String = process.stdout.readLine();
var commitHashSplice:String = commitHash.substr(0, 7);
process.close();
return commitHashSplice;
}
@ -955,6 +957,8 @@ class Project extends HXProject {
var branchName:String = branchProcess.stdout.readLine();
branchProcess.close();
return branchName;
}
@ -979,6 +983,8 @@ class Project extends HXProject {
}
}
branchProcess.close();
return output.length > 0;
}

View file

@ -23,6 +23,8 @@ class GitCommit
var commitHash:String = process.stdout.readLine();
var commitHashSplice:String = commitHash.substr(0, 7);
process.close();
trace('Git Commit ID: ${commitHashSplice}');
// Generates a string expression
@ -52,6 +54,7 @@ class GitCommit
}
var branchName:String = branchProcess.stdout.readLine();
branchProcess.close();
trace('Git Branch Name: ${branchName}');
// Generates a string expression
@ -84,6 +87,7 @@ class GitCommit
try
{
output = branchProcess.stdout.readLine();
branchProcess.close();
}
catch (e)
{