Index: src/ch/TSubTaskScanDirectory.cpp =================================================================== diff -u -r9a171c5d46f2bc029d99a698d88eeff60497cd3b -rb0d7cb2020371c35b5fbaab566b4dcc850fed460 --- src/ch/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) +++ src/ch/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision b0d7cb2020371c35b5fbaab566b4dcc850fed460) @@ -224,6 +224,9 @@ while(finder.FindNext(spFileInfo)) { + if(rThreadController.KillRequested()) + break; + if(!spFileInfo->IsDirectory()) { if(afFilters.Match(spFileInfo)) @@ -246,9 +249,6 @@ if(bRecurse) ScanDirectory(pathCurrent, stSrcIndex, bRecurse, bIncludeDirs, afFilters); } - - if(rThreadController.KillRequested()) - break; } return 0; Index: src/ch/TWorkerThreadController.cpp =================================================================== diff -u -r44c811ed2e152c83d92aa7d0b41497a90a177209 -rb0d7cb2020371c35b5fbaab566b4dcc850fed460 --- src/ch/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision 44c811ed2e152c83d92aa7d0b41497a90a177209) +++ src/ch/TWorkerThreadController.cpp (.../TWorkerThreadController.cpp) (revision b0d7cb2020371c35b5fbaab566b4dcc850fed460) @@ -27,7 +27,7 @@ m_hThread(NULL), m_hKillThread(NULL) { - m_hKillThread = CreateEvent(NULL, FALSE, FALSE, NULL); + m_hKillThread = CreateEvent(NULL, TRUE, FALSE, NULL); if(!m_hKillThread) THROW(_T(""), 0, GetLastError(), 0); }