Skip to content

Commit

Permalink
wait until QThreadPool is finished before quitting application
Browse files Browse the repository at this point in the history
  • Loading branch information
EtlamGit committed Aug 5, 2019
1 parent aad4804 commit 15bbb1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions minutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ Minutor::Minutor() {
emit worldLoaded(false);
}

Minutor::~Minutor() {
// wait for sheduled tasks
QThreadPool::globalInstance()->waitForDone();
}


void Minutor::openWorld() {
QAction *action = qobject_cast<QAction*>(sender());
if (action)
Expand Down
1 change: 1 addition & 0 deletions minutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Minutor : public QMainWindow {

public:
Minutor();
~Minutor();

void loadWorld(QDir path);

Expand Down

0 comments on commit 15bbb1c

Please sign in to comment.