*/
void CDirDoc::InitCompare(const PathContext & paths, bool bRecursive, CTempPathContext *pTempPathContext)
{
+ // Abort previous comparing
+ while (m_diffThread.GetThreadState() == CDiffThread::THREAD_COMPARING)
+ {
+ m_diffThread.Abort();
+ Sleep(50);
+ }
+
m_pDirView->DeleteAllDisplayItems();
// Anything that can go wrong here will yield an exception.
// Default implementation of operator new() never returns NULL.
if (wParam == CDiffThread::EVENT_COMPARE_COMPLETED)
{
// Close and destroy the dialog after compare
- GetParentFrame()->ShowControlBar(m_pCmpProgressBar.get(), FALSE, FALSE);
+ if (m_pCmpProgressBar)
+ GetParentFrame()->ShowControlBar(m_pCmpProgressBar.get(), FALSE, FALSE);
m_pCmpProgressBar.reset();
pDoc->CompareReady();