mavlink.net icon indicating copy to clipboard operation
mavlink.net copied to clipboard

Memory leak in class BlockingCircularStream

Open MartinStokelj opened this issue 5 years ago • 0 comments

I use create and dispose mavlink every 15 seconds if there is no connection to drone. I think that there is memory leak in class BlockingCircularStream with the mBuffer since he do not get disposed.

public MavLinkAsyncWalker()
{
	mProcessStream = new BlockingCircularStream(DefaultCircularBufferSize);

	ThreadPool.QueueUserWorkItem(new WaitCallback(PacketProcessingWorker));
}

public class BlockingCircularStream : Stream
{
	private byte[] mBuffer;

	public BlockingCircularStream(int bufferCapacity)
	{
		mCapacity = bufferCapacity;
		mBuffer = new byte[bufferCapacity];
	}
}

MartinStokelj avatar Jul 22 '20 08:07 MartinStokelj