When X3dAudio.Calculate method is invoked for an emitter with a non-null Cone, an exception is raised indicating an invalid memory access.
To solve this, I have removed the Marshal.FreeHGlobal(ConePointer) invocation from the Emitter.Native.MarshalFree() method. That causes the exception, seeing that this structure is always allocated in the stack and no memory is allocated using Marshal.AllocHGlobal.
When X3dAudio.Calculate method is invoked for an emitter with a non-null Cone, an exception is raised indicating an invalid memory access.
To solve this, I have removed the Marshal.FreeHGlobal(ConePointer) invocation from the Emitter.Native.MarshalFree() method. That causes the exception, seeing that this structure is always allocated in the stack and no memory is allocated using Marshal.AllocHGlobal.