[libcalamaresui] Make sure finished() is processed once

- Avoid races which might double-delete the timer, or enter
   the if twice (which would lead to duplicate emissions of
   requirementsComplete and the associated UI glitches).
This commit is contained in:
Adriaan de Groot 2019-05-27 17:15:49 +02:00
parent 2b91608b82
commit 2e39f24bb0

View File

@ -99,6 +99,9 @@ RequirementsChecker::run()
void
RequirementsChecker::finished()
{
static QMutex finishedMutex;
QMutexLocker lock( &finishedMutex );
if ( m_progressTimer && std::all_of( m_watchers.cbegin(), m_watchers.cend(), []( const Watcher *w ) { return w && w->isFinished(); } ) )
{
cDebug() << "All requirements have been checked.";