Skip to content
Permalink
Browse files

Revert torrent thread back to local var to fix crashing issue; re-rel…

…ease 1.1.0
  • Loading branch information...
kz26 committed Dec 9, 2013
1 parent ee764f8 commit 99697f36ad17c6c28136fc20722d1ee4bec0e6e4
Showing with 6 additions and 16 deletions.
  1. +5 −9 creationpage.cpp
  2. +0 −4 creationpage.h
  3. +1 −3 wizard.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());
}
@@ -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);
@@ -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);
}

0 comments on commit 99697f3

Please sign in to comment.
You can’t perform that action at this time.