I wrote a C++ library (.so file) that can be called from python or from another C++ program. The library contains a global map to shared_ptr (where complex_object stands for some class that does not allocate memory dynamically through 'new'). At the end of execution, the map should be erased automatically, as well as the objects pointed to by the smart pointers.
When using this library within a C++ program, everything works fine. But when using it from a python program, there is a seg-fault error at the end of execution (after the correct results have been produced). The problem seems to be linked to freeing the memory associated with the map:
* glibc detected * python: double free or corruption (fasttop)
My question is : Does anyone know of issues when releasing memory within a shared object library at the end of a python program?