Skip to content

Commit

Permalink
ModuleManager
Browse files Browse the repository at this point in the history
- On error or success close the file if it was opened for `readModuleData(ModuleEntry ent, ref string source)`
  • Loading branch information
deavmi committed Oct 29, 2023
1 parent c0ae4fe commit 80a3a4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/tlang/compiler/modman/modman.d
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ public final class ModuleManager
{
File modFile;

scope(exit)
{
if(modFile.isOpen())
{
modFile.close();
}
}

try
{
modFile.open(ent.filename, "rb");
Expand Down

0 comments on commit 80a3a4c

Please sign in to comment.