Only gc.collect() under windows · pythonthings/GitPython@454feda · GitHub
Skip to content

Commit 454feda

Browse files
author
James E. Blair
committed
Only gc.collect() under windows
Under Windows, tempfile objects are holding references to open files until the garbage collector closes them and frees them. Explicit calls to gc.collect() were added to the finalizer for the Repo class to force them to be closed synchronously. However, this is expensive, especially in large, long-running programs. As a temporary measure to alleviate the performance regression on other platforms, only perform these calls when running under Windows. Fixes gitpython-developers#553
1 parent f237620 commit 454feda

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

git/repo/base.py

Lines changed: 10 additions & 2 deletions

0 commit comments

Comments
 (0)