Unfortunately due to optimised build of Python3 libraries and executable I got only partial stack from [http://clang.llvm.org/docs/AddressSanitizer.html], however digging into and reducing my code I tracked it down to be issue with `boost/libs/python/src/object/enum.cpp`.
It has to bits that leak (and comment mentioning there is one):
PyObject *mod = PyObject_GetAttrString( self_, "__module__");
Leaks reference, as it never decreases it.
It also stores a new string object under object's `name` that ref count never gets decremented.
That commit fixes both issues.
This was properly an oversight when switching to the BOOST_SYMBOL_*
symbols from Boost.Config in commit 0224f54a (see #1)
Since Boost.Config is already doing the differentiation between
different platforms and compilers we can simplify this bit and just
use BOOST_SYMBOL_EXPORT
This was reusing the Python 2 name on Python 3, which is incorrect since
the Python 3 library for Boost.NumPy has a `3` in it. Hence this checks
against the Python version and defines this correctly.
This was reusing the Python 2 name on Python 3, which is incorrect since
the Python 3 library for Boost.Python now has a `3` in it. Hence this
checks against the Python version and defines this correctly.
Nearly every header in the boost codebase is UTF-8, but here there
are a few headers which are using Windows-1252, which makes it impossible
for some tools to parse those files. This patch just reencodes them
with UTF-8 like the rest of the codebase. I checked that the name of the
author is still correct after this change.
No functional change intended.
Many times the caller may have a string created in C++,
so there is no need to wrap it in a Python object when
the only thing done with the object is extract<char*>.