Skip to content

Commit

Permalink
Revert torrent thread back to local var to fix crashing issue; re-rel…
Browse files Browse the repository at this point in the history
…ease 1.1.0
  • Loading branch information
kz26 committed Dec 9, 2013
1 parent ee764f8 commit 99697f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
14 changes: 5 additions & 9 deletions creationpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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());
}
4 changes: 0 additions & 4 deletions creationpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 99697f3

Please sign in to comment.