Skip to content

Commit 9ba1649

Browse files
committed
fix(leaks): FIX memoryview leak in Windows
+ All gitdb TCs now pass without explit release!
1 parent d81dc1d commit 9ba1649

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

smmap/util.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
except NameError:
2323
# Python 3 has no `buffer`; only `memoryview`
2424
def buffer(obj, offset, size):
25-
# Actually, for gitpython this is fastest ... .
26-
return memoryview(obj)[offset:offset + size]
27-
# doing it directly is much faster !
28-
# return obj[offset:offset + size]
25+
# Actually, for gitpython this is fastest ... but `memoryviews` LEAK!
26+
#return memoryview(obj)[offset:offset + size]
27+
return obj[offset:offset + size]
2928

3029

3130
PY3 = sys.version_info[0] >= 3

0 commit comments

Comments
 (0)