Skip to content

Commit

Permalink
Avoid leaking repo.lock handle
Browse files Browse the repository at this point in the history
The repo.lock file would be opened when installing a distribution,
but would never get closed. On windows this could manifest as an
error saying it can't delete repo.lock because the resource is
busy. This updates CURI.install to close the repo.lock file when
leaving the function.
  • Loading branch information
ugexe committed Feb 10, 2024
1 parent b151e2d commit 155818f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core.c/CompUnit/Repository/Installation.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ sub MAIN(*@, *%) {
my @*MODULES;
my $path = self!writeable-path or die "No writeable path found, $.prefix not writeable";
my $lock = $.prefix.add('repo.lock').open(:create, :w);
LEAVE $lock.close;
$lock.lock;

my $version = self!repository-version;
Expand Down

0 comments on commit 155818f

Please sign in to comment.