fix: leave ref_small_vector source empty after move (#6161)
* fix: leave ref_small_vector source empty after move
Fixes item 24 of #6159.
* test: do not keep a module reference across the interpreter restart
The enum restart test kept a py::module_ from the old interpreter alive
across finalize_interpreter(), then decref'd that stale pointer into
memory the new interpreter had reused. Depending on allocation layout
this corrupted a live object and crashed in the next finalize (seen on
Clang 5 / Python 3.9 CI after the ref_small_vector change shifted the
allocation pattern).
3 files changed