lava / matplotlib-cpp

Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
MIT License
4.38k stars 1.13k forks source link

fix segfault on exit with python3 #301

Open amadeus84 opened 2 years ago

amadeus84 commented 2 years ago

Followed up on the analysis in this discussion https://stackoverflow.com/questions/67533541/py-finalize-resulting-in-segmentation-fault-for-python-3-9-but-not-for-python/67577360#67577360

and fixed the segfault by explicitly killing the _interpreter before return. I added that to all examples.

And while at it, I added a standalone compilation command (g++) as a comment and I fixed indentation in all examples, for convenience and consistency.