Fix memory leak in new streaming (second attempt)

This commit is contained in:
oobabooga 2023-03-11 23:14:49 -03:00
parent 92fe947721
commit 37f0166b2d
2 changed files with 4 additions and 2 deletions

View file

@ -49,7 +49,7 @@ class Iteratorize:
def __init__(self, func, kwargs={}, callback=None):
self.mfunc=func
self.c_callback=callback
self.q = Queue(maxsize=1)
self.q = Queue()
self.sentinel = object()
self.kwargs = kwargs
@ -73,3 +73,6 @@ class Iteratorize:
raise StopIteration
else:
return obj
def __del__(self):
pass