Skip to content
Snippets Groups Projects
Commit 1b91a477 authored by Andreas Schenk's avatar Andreas Schenk
Browse files

Fixed gosty application shutdown. Now both the Qt aboutToQuit signal and

the python atexit work as expected.
parent 85e28409
Branches
Tags
No related merge requests found
......@@ -93,7 +93,9 @@ void GostyMainWindow::OnQuit()
//SetFullScreen(false);
GostyApp::Instance()->OnQuit();
deleteLater();
QApplication::exit(0);
// exit has to be called on the instance not the class,
// otherwise the aboutToQuit singal doesn't get emitted
QApplication::instance()->exit(0);
}
void GostyMainWindow::closeEvent(QCloseEvent * event)
......
......@@ -72,8 +72,6 @@ QMessageBox::Icon LogReader::GetIconForSeverity(int severity){
}
LogReader::~LogReader() {
ost::Logger& logger = ost::Logger::Instance();
logger.PopSink();
}
}
......
......@@ -51,6 +51,12 @@ PythonInterpreterWorker::PythonInterpreterWorker():
main_namespace_["sys"].attr("stdout") = output_redirector_;
}
PythonInterpreterWorker::~PythonInterpreterWorker()
{
// we have to manually run the exit functions because we cannot use Py_Finalize due to some problems in boost python
run_command_(std::pair<unsigned int, QString>(0,"import atexit\natexit._run_exitfuncs()\n"));
}
void PythonInterpreterWorker::Wake()
{
if (awake_) return;
......
......@@ -20,6 +20,7 @@ class PythonInterpreterWorker: public QObject
Q_OBJECT
public:
PythonInterpreterWorker();
~PythonInterpreterWorker();
unsigned int AddCommand(const QString& command);
signals:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment