Skip to content

Commit

Permalink
GUI: Update worker type if task already exist.
Browse files Browse the repository at this point in the history
So it doesn't invalidly re-use the cached one.
  • Loading branch information
furszy committed Mar 11, 2021
1 parent a1390c3 commit ca3edc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/qt/pivx/loadingdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Worker : public QObject {
runnable = nullptr;
}
virtual void clean() {};
void setType(int _type) { type = _type; }
public Q_SLOTS:
void process();
Q_SIGNALS:
Expand Down
2 changes: 2 additions & 0 deletions src/qt/pivx/pwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ bool PWidget::execute(int type, std::unique_ptr<WalletModel::UnlockContext> pctx
WalletWorker* _worker = static_cast<WalletWorker*>(task->worker.data());
_worker->setContext(std::move(pctx));
}
// Update type
task->worker->setType(type);
}
QThreadPool::globalInstance()->start(task.data());
return true;
Expand Down

0 comments on commit ca3edc5

Please sign in to comment.