theseion / libgit2-pharo-bindings

libgit2 bindings for Pharo
http://theseion.github.io/libgit2-pharo-bindings
7 stars 29 forks source link

Unreleased file handles #37

Open theseion opened 9 years ago

theseion commented 9 years ago

libgit2 hold on to the file handle for the pack file. This becomes a problem on Windows, where a file can only be (completely) deleted after all handles have been closed.

This may be a problem with objects that aren't properly freed. However, the pack file seems to be the only file with this problem, so the error might actually lie with libgit2 itself.

See:

tinchodias commented 9 years ago

Interesting. So, this is the reason of the failing tests in Win7.

theseion commented 9 years ago

That's one reason. The other one is that the DeleteFile function used by FilePlugin to delete files on Windows cannot delete files which have the read-only attribute set. I'm submitting a fix where i try to remove the read-only attribute by calling SetFileAttributes before calling DeleteFile.

tinchodias commented 9 years ago

Superb. Is the file handle that libgit2 holds to the pack file read-only?

theseion commented 9 years ago

Probably not. But I haven't had time to dig into libgit2 yet.