Hi Patrick,
I finally had time to go back a version in Unity (2019.1.14) and made a very barebone test project to make sure nothing is interfering)
The cleanup procedure is promising and implemented, now Unity is not freezing any more but crashing properly (progress..
Apparently there is an access violation when calling spatial.open, specifically when the spatial is trying to asign spatial_attach(which in my barbone-case is just setting a bool)
There seems to be a timing-issue. When I debug in visual Studio and step through the code, it's working fine, I'm even getting "spatial_data".. , when I exit debugging, everything is running fine. Only when starting normally, I get this crash. I'm not sure how to resolve this...
This is the actual crash-log:
Unity Editor by Unity Technologies [version: Unity 2019.1.14f1_148b5891095a]
phidget22.DLL caused an Access Violation (0xc0000005)
in module phidget22.DLL at 0033:a61c80c4.
Error occurred at 2019-10-03_143112.
C:\Program Files\Unity\Hub\Editor\2019.1.14f1\Editor\Unity.exe, run by conta.
56% physical memory in use.
32730 MB physical memory [14352 MB free].
1964 MB process peak paging file [1709 MB used].
1017 MB process peak working set [1016 MB used].
System Commit Total/Limit/Peak: 34927MB/65460MB/46419MB
System Physical Total/Available: 32730MB/14352MB
System Process Count: 354
System Thread Count: 6378
System Handle Count: 221669
Disk space data for 'C:\Users\conta\AppData\Local\Temp\Unity\Editor\Crashes\Crash_2019-10-03_123104468\': 63713464320 bytes free of 1010640150528 total.
Read from location 00000000DEADBF0F caused an access violation.
Context:
RDI: 0x0000000000000000 RSI: 0x0000000000000000 RAX: 0x00000000deadbeef
RBX: 0x00000211a1399980 RCX: 0x00000211a1399980 RDX: 0x00000211a1399980
RIP: 0x00000211a61c80c4 RBP: 0x00000041b05ff830 SegCs: 0x0000021100000033
EFlags: 0x0000000000010297 RSP: 0x00000041b05ff758 SegSs: 0x000002110000002b
R8: 0x0000000000000000 R9: 0x0000000000000001 R10: 0x00000211ec13b7c0
R11: 0x00000211a61160f5 R12: 0x0000000000000000 R13: 0x0000000000000000
R14: 0x0000000000000000 R15: 0x00000211a1399980
Bytes at CS:EIP:
48 ff 60 20 cc cc cc cc cc cc cc cc 48 8b d1 48
Mono DLL loaded successfully at 'C:\Program Files\Unity\Hub\Editor\2019.1.14f1\Editor\Data\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll'.
Stack Trace of Crashed Thread 27744:
0x00000211A61C80C4 (phidget22) PhidgetLock
0x00000211A62028C2 (phidget22) Phidget_setOnAttachHandler
0x000002119ECC1B8A (Phidget22.NET) Phidget22.Phidget22Imports.Phidget_setOnAttachHandler()
0x00000211A6B469BB (Phidget22.NET) Phidget22.Phidget.uninitializeBaseEvents()
0x00000211A6B4672B (Phidget22.NET) Phidget22.Spatial.uninitializeEvents()
0x00000211A6B4650F (Phidget22.NET) Phidget22.Spatial.Finalize()
0x00000211A96E94DC (mscorlib) System.Object.runtime_invoke_virtual_void__this__()
0x00007FFFC7CA2EE9 (mono-2.0-bdwgc) mono_gc_reference_queue_new
0x00007FFFC7E9ACD2 (mono-2.0-bdwgc) GC_gcj_malloc
0x00007FFFC7CA1DA9 (mono-2.0-bdwgc) mono_callspec_parse
0x00007FFFC7C65268 (mono-2.0-bdwgc) mono_threads_set_shutting_down
0x00007FFFC7C64FF6 (mono-2.0-bdwgc) mono_threads_set_shutting_down
0x00007FF840367BD4 (KERNEL32) BaseThreadInitThunk
0x00007FF841D4CEE1 (ntdll) RtlUserThreadStart
....