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

examples: fix segfault on exit with python3 #300

Closed amadeus84 closed 2 years ago

amadeus84 commented 2 years ago

This code change addresses the segfault on exit with python3 reported here

https://github.com/lava/matplotlib-cpp/issues/268

It's a follow-up on the explanation provided by unddoch in this stackoverflow discussion:

https://stackoverflow.com/questions/67533541/py-finalize-resulting-in-segmentation-fault-for-python-3-9-but-not-for-python/67577360#67577360

Also, added compile command as comment, to all examples, for convenience and fixed indentation, to make it consistent across all examples.