From 99697f36ad17c6c28136fc20722d1ee4bec0e6e4 Mon Sep 17 00:00:00 2001 From: kz26 Date: Mon, 9 Dec 2013 15:57:16 -0600 Subject: [PATCH] Revert torrent thread back to local var to fix crashing issue; re-release 1.1.0 --- creationpage.cpp | 14 +++++--------- creationpage.h | 4 ---- wizard.cpp | 4 +--- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/creationpage.cpp b/creationpage.cpp index a16a82b..5d58995 100644 --- a/creationpage.cpp +++ b/creationpage.cpp @@ -61,15 +61,11 @@ void CreationPage::triggerFinished() { emit completeChanged(); } -void CreationPage::killThread() { - this->ctThread->exit(); -} - void CreationPage::initializePage() { - this->ctThread = new CreateTorrent(this); - connect(this->ctThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgress(int))); - connect(this->ctThread, SIGNAL(logStatusMessage(QString)), this, SLOT(logAddedFile(QString))); - connect(this->ctThread, SIGNAL(finished()), this, SLOT(triggerFinished())); + CreateTorrent *ctThread = new CreateTorrent(this); + connect(ctThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgress(int))); + connect(ctThread, SIGNAL(logStatusMessage(QString)), this, SLOT(logAddedFile(QString))); + connect(ctThread, SIGNAL(finished()), this, SLOT(triggerFinished())); using namespace libtorrent; @@ -84,5 +80,5 @@ void CreationPage::initializePage() { else pieceSize = 1024 * (2 << (pieceSizeIndex + 2)); - this->ctThread->makeTorrentFiles(field("inputPath").toString(), field("outputPath").toString(), field("batchMode").toBool(), field("announceUrls").toString(), field("webSeeds").toString(), field("comment").toString(), QString("%1 %2").arg(PROGRAM_NAME, PROGRAM_VERSION), pieceSize, flags, field("privateTorrent").toBool()); + ctThread->makeTorrentFiles(field("inputPath").toString(), field("outputPath").toString(), field("batchMode").toBool(), field("announceUrls").toString(), field("webSeeds").toString(), field("comment").toString(), QString("%1 %2").arg(PROGRAM_NAME, PROGRAM_VERSION), pieceSize, flags, field("privateTorrent").toBool()); } diff --git a/creationpage.h b/creationpage.h index b444864..ff12c9d 100644 --- a/creationpage.h +++ b/creationpage.h @@ -42,13 +42,9 @@ class CreationPage : public QWizardPage void initializePage(); bool isComplete() const; -public slots: - void killThread(); - private: Ui::CreationPage *ui; bool torrentDone; - CreateTorrent *ctThread; private slots: void updateProgress(int i); diff --git a/wizard.cpp b/wizard.cpp index 47633ad..f38c983 100644 --- a/wizard.cpp +++ b/wizard.cpp @@ -48,9 +48,7 @@ Wizard::Wizard(QWidget *parent) : this->addPage(new TrackersPage); this->addPage(new PropertiesPage); this->addPage(new SummaryPage); - CreationPage *creationPage = new CreationPage; - connect(this, SIGNAL(rejected()), creationPage, SLOT(killThread())); - this->addPage(creationPage); + this->addPage(new CreationPage); this->setOption(this->DisabledBackButtonOnLastPage, true); }