Serhiy Storchaka added the comment:

Currently do_mktuple(), do_mklist() and do_mkdict() save references in a 
collection. I think that there are reasons to do this, and third-party code can 
be broken if just deallocate references. pybuildvalue_leak4.patch just 
implements this strategy more reliably. It guaranties (unless tuple allocation 
fails) that borrowed references in the same container or upper levels are kept 
until all content of the container is proceeded.

The more perfect solution is to allocate one list on error, save all references 
to it and deallocate it at the end of PyBuildValue(). But this leads to more 
complicated code.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26168>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to