From 1b2720d5030827b223aac1ec6a065712cdc035e2 Mon Sep 17 00:00:00 2001 From: Boo Yee Date: Thu, 3 Aug 2023 11:24:39 +0800 Subject: [PATCH] Fix the issue: regression since v2.1.9: nixnote2 no longer exiting cleanly (terminated by SIGABRT) #208 --- src/gui/nbrowserwindow.cpp | 1 + src/nixnote.cpp | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/nbrowserwindow.cpp b/src/gui/nbrowserwindow.cpp index 940ebd58..c10bd176 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()"; }