Memory leak in winforms C#
ahmedtalaat327 opened this issue ยท 0 comments
ahmedtalaat327 commented
Describe the bug
I cant end the thread even if uses :
SignalToStop()
func.
this is a piece of code ๐
`
private void Exitcamera()
{
videoCaptureDevice.SignalToStop();
// FinalVideo.WaitForStop(); << marking out that one solved it
//videoCaptureDevice.Stop();
videoCaptureDevice.NewFrame -= new NewFrameEventHandler(VideoCaptureDevice_NewFrame); // as sugested
videoCaptureDevice = null;
}
`
Expected behavior
the thread must end but when I try to exit the window application the app still in processes
Desktop (please complete the following information):
- OS: Windows 11
- Visual studio x64