InstallationPage: properly exit the QThread (Fixes #2210)

openmw-38
scrawl 9 years ago
parent 1264651af7
commit 2f9b404094

@ -28,12 +28,6 @@ Wizard::InstallationPage::InstallationPage(QWidget *parent) :
connect(mUnshield, SIGNAL(finished()), connect(mUnshield, SIGNAL(finished()),
mThread, SLOT(quit())); mThread, SLOT(quit()));
connect(mUnshield, SIGNAL(finished()),
mUnshield, SLOT(deleteLater()));
connect(mUnshield, SIGNAL(finished()),
mThread, SLOT(deleteLater()));;
connect(mUnshield, SIGNAL(finished()), connect(mUnshield, SIGNAL(finished()),
this, SLOT(installationFinished()), Qt::QueuedConnection); this, SLOT(installationFinished()), Qt::QueuedConnection);
@ -60,6 +54,7 @@ Wizard::InstallationPage::~InstallationPage()
{ {
if (mThread->isRunning()) { if (mThread->isRunning()) {
mUnshield->stopWorker(); mUnshield->stopWorker();
mThread->quit();
mThread->wait(); mThread->wait();
} }

@ -45,9 +45,7 @@ Wizard::UnshieldWorker::~UnshieldWorker()
void Wizard::UnshieldWorker::stopWorker() void Wizard::UnshieldWorker::stopWorker()
{ {
mMutex.lock();
mStopped = true; mStopped = true;
mMutex.unlock();
} }
void Wizard::UnshieldWorker::setInstallComponent(Wizard::Component component, bool install) void Wizard::UnshieldWorker::setInstallComponent(Wizard::Component component, bool install)

@ -104,7 +104,6 @@ namespace Wizard
QTextCodec *mIniCodec; QTextCodec *mIniCodec;
QWaitCondition mWait; QWaitCondition mWait;
QMutex mMutex;
QReadWriteLock mLock; QReadWriteLock mLock;

Loading…
Cancel
Save