mitsuba-renderer / mitsuba3

Mitsuba 3: A Retargetable Forward and Inverse Renderer
https://www.mitsuba-renderer.org/
Other
2.1k stars 246 forks source link

More robust shutdown #1272

Closed njroussel closed 3 months ago

njroussel commented 3 months ago

Description

Fixes unexpected segfaults or faulty logs during the Python session shutdown.

This was mostly due to an incorrect order in the shutdown routines and some of them not being triggered due to dangling references. In particular, a PyModuleDef's m_free attribute will not be called if there are still some references to the module.

(cc @bathal1)

Testing

No new tests were added - capturing the corrected behavior is too complex in pytest.