diff --git a/src/gui/nbrowserwindow.cpp b/src/gui/nbrowserwindow.cpp index 940ebd58..19904588 100644 --- a/src/gui/nbrowserwindow.cpp +++ b/src/gui/nbrowserwindow.cpp @@ -308,6 +308,7 @@ NBrowserWindow::NBrowserWindow(QWidget *parent) : NBrowserWindow::~NBrowserWindow() { browserThread->quit(); while (!browserRunner->isIdle); + while (!browserThread->isFinished()); delete browserThread; delete browserRunner; diff --git a/src/nixnote.cpp b/src/nixnote.cpp index 32ccd9fa..4069a254 100644 --- a/src/nixnote.cpp +++ b/src/nixnote.cpp @@ -243,6 +243,7 @@ NixNote::NixNote(QWidget *parent) : QMainWindow(parent) { // Destructor to call when all done NixNote::~NixNote() { + QLOG_DEBUG() << "~NixNote: Closing threads"; syncThread.quit(); indexThread.quit(); counterThread.quit(); @@ -1299,10 +1300,6 @@ void NixNote::saveOnExit() { saveNoteColumnPositions(); noteTableView->saveColumnsVisible(); - QLOG_DEBUG() << "saveOnExit: Closing threads"; - indexThread.quit(); - counterThread.quit(); - QLOG_DEBUG() << "Exiting saveOnExit()"; }