Cppcheck: Kill current check process only when needed

Kill only if it processes specified files

Change-Id: I5dee99ec8aeaf3bf4d9dbf6aad195f54176170a2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Sergey Morozov
2018-09-22 14:22:03 +03:00
parent 546956a302
commit f01ee04f4f
3 changed files with 8 additions and 6 deletions

View File

@@ -87,17 +87,19 @@ void CppcheckRunner::addToQueue(const Utils::FileNameList &files,
}
if (m_isRunning) {
if (existing == m_currentFiles)
m_process->kill(); // Further processing in handleFinished
stop(existing);
return;
}
m_queueTimer.start();
}
void CppcheckRunner::stop()
void CppcheckRunner::stop(const Utils::FileNameList &files)
{
if (m_isRunning)
if (!m_isRunning)
return;
if (files.isEmpty() || m_currentFiles == files)
m_process->kill();
}