public void CleanUp() { if( _mainBufferHandle.IsAllocated ) { _mainBufferHandle.Free(); _mainBufferPointer = System.IntPtr.Zero; } }