mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix memory leak during parallel writing with multiplied warnings.
This commit is contained in:
parent
25f3266def
commit
704619878e
@ -357,9 +357,11 @@ class Builder(object):
|
||||
|
||||
def _write_parallel(self, docnames, warnings, nproc):
|
||||
def write_process(docs):
|
||||
local_warnings = []
|
||||
self.env.set_warnfunc(lambda *args: local_warnings.append(args))
|
||||
for docname, doctree in docs:
|
||||
self.write_doc(docname, doctree)
|
||||
return warnings
|
||||
return local_warnings
|
||||
|
||||
def add_warnings(docs, wlist):
|
||||
warnings.extend(wlist)
|
||||
|
@ -101,7 +101,9 @@ class ParallelTasks(object):
|
||||
del self._threads[tid]
|
||||
if exc:
|
||||
raise SphinxParallelError(*result)
|
||||
self._result_funcs.pop(tid)(arg, result)
|
||||
result_func = self._result_funcs.pop(tid)(arg, result)
|
||||
if result_func:
|
||||
result_func(result)
|
||||
self._nprocessed += 1
|
||||
|
||||
def join(self):
|
||||
@ -110,7 +112,9 @@ class ParallelTasks(object):
|
||||
del self._threads[tid]
|
||||
if exc:
|
||||
raise SphinxParallelError(*result)
|
||||
self._result_funcs.pop(tid)(arg, result)
|
||||
result_func = self._result_funcs.pop(tid)(arg, result)
|
||||
if result_func:
|
||||
result_func(result)
|
||||
self._nprocessed += 1
|
||||
|
||||
# there shouldn't be any threads left...
|
||||
|
Loading…
Reference in New Issue
Block a user