[libcalamares] Stop job threads before exit

- This solves a crash where the thread is destroyed while still
   running (e.g. cancelling during install).
 - The thread might not cooperate in being terminated, but then we
   have a bigger problem anyway (and Calamares will still crash on
   exit).

FIXES #1164
main
Adriaan de Groot 6 years ago
parent e49beaea91
commit 61b78d8895

@ -157,6 +157,14 @@ JobQueue::JobQueue( QObject* parent )
JobQueue::~JobQueue()
{
if ( m_thread->isRunning() )
{
m_thread->terminate();
if ( !m_thread->wait(300) )
cError() << "Could not terminate job thread (expect a crash now).";
delete m_thread;
}
delete m_storage;
}

Loading…
Cancel
Save