Serhiy Storchaka added the comment: Previous attempt to fix reference leaks was in issue984722.
Proposed patch uses different approach. It correctly fixes reference leaks after error in processing dict items (like "{()s(())N"), fixes leaksafter memory errors on creating tuple, list or dict, fixes issue20024 for lists and dicts, fixes use-after-free issue described in msg259242. But the patch has a disadvantage in comparison with current code. If user converter ("O&") accepts Python objects and steal its reference (as "N"), this reference will be leaked. This is a price for avoiding potential use-after-free issues. Current stdlib code doesn't use converters that steal Python object reference. May be we should document this limitation. ---------- nosy: +mwh, rhettinger, shredwheat Added file: http://bugs.python.org/file41757/pybuildvalue_leak2.patch _______________________________________ 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