Cleanup code with Linux
Unsolved
General and Desktop
-
Hello,
I want to do proper cleanup before the linux application is closed by the user (SIGINT etc.).
So I have to catch these linux signals because Qt's event loop (QCoreApplication::exec) doesn't react on them.I wanted to simply call QCoreApplication::quit() in the signal handler, but stop! quit() isn't documented as reentrant.
It works but it's not correct I guess because what if Qt is checking the event queue while SIGINT arrives and calls quit() which manipulates that event queue... race condition?Thank you!
-
Hi @qtacc32, this might help: http://doc.qt.io/qt-5/unix-signals.html