--- a/src/relpipe-out-chart.cpp Sat Sep 29 12:58:04 2018 +0200
+++ b/src/relpipe-out-chart.cpp Sat Sep 29 13:26:33 2018 +0200
@@ -24,6 +24,7 @@
WorkerThread(std::shared_ptr<RelationalReader> reader) :
reader(reader) {
+ setTerminationEnabled(true);
}
void run() {
@@ -31,6 +32,7 @@
reader->process();
} catch (RelpipeReaderException& e) {
// TODO: handle exception, show error dialog
+ std::wcerr << L"RelpipeReaderException: " << e.getMessge() << std::endl;
}
}
};
@@ -67,5 +69,13 @@
app.exec();
//return app.exec();
+ if (t.isRunning()) {
+ std::wcerr << L"Background RelationalReader thread is still running → terminate()" << std::endl;
+ t.terminate();
+ std::wcerr << L"Background RelationalReader thread was terminated → wait()" << std::endl;
+ t.wait();
+ std::wcerr << L"Background RelationalReader thread wait() finished" << std::endl;
+ }
+
return resultCode;
}