Hi,
I am createing a thread in my mfc application in which I am playing video using Direct Show. But when I terminate thread then I am getting memory leak problem.
Please help me as soon as possible.
Following is code in which I am terminating thread:
Code:
if(m_pEditViewMC != 0)
	{
		m_pEditViewMC->Stop();
		m_PrevuBtnSate = PrevuOFF;
		m_pEditViewMC = 0;
	}
	if(m_PreviewThread)
	{
		DWORD exitcd;
		BOOL bThrState = GetExitCodeThread(m_PreviewThread->m_hThread, &exitcd);
		if(bThrState && (exitcd == STILL_ACTIVE))
		{
			TerminateThread(m_PreviewThread->m_hThread, 0);
			delete m_PreviewThread;
			m_PreviewThread = 0;
		}
	}
	CleanVMR9();
	/*m_btnStopPreview.EnableWindow(false);
	m_btnPlayPreview.EnableWindow(true);*/
	if(!m_bDeavtivateOnce){
		ToggleStartStop(true);
	}
	else
		m_bDeavtivateOnce = !m_bDeavtivateOnce;
	this->SetFocus();
Thanks and Regards,
Sukhraj Singh