Environment
- Pythonnet version: 3.0.0/3.0.1
- Python version: 3.10.6
- Operating System: windows 10
- .NET Runtime: mono/Unity, but repros on non-mono too.
Details
Calling len()
or __len()__
on an array (like string[]
) object after a domain reload results in either a DomainUnloadedException or an AccessViolationException (and sometimes, other types of exceptions). In Unity, this always result in a crash.
I've tried to debug, but couldn't find a solid lead. My hunch is that the slot doesn't get properly set/reset on domain reload.
The example is easier to see with a unit test: https://github.com/Unity-Technologies/pythonnet/tree/array_len_reload